SOLVED How to Promote a Replicant to be Primary?

Status
Not open for further replies.

hokan

Dabbler
Joined
Feb 10, 2017
Messages
42
I have two identical systems running FreeNAS. The Main system is used for storage; the other is for replication from the main system.

What is the process for making the replicant into the primary system (for example, in case the primary is damaged)?
 

I0nize

Cadet
Joined
Aug 18, 2014
Messages
5
I have a similar setup and recently swapped by primary and secondary machines. The secondary/pull data sets were automatically set to read only file systems. once I was ready to switch them I just removed the replication tasks on the primary machine then ran "zfs set readonly=off tank/dataset" command on all the datasets on the secondary machine to turn off read only then I was good to go.
 
Last edited:

hokan

Dabbler
Joined
Feb 10, 2017
Messages
42
OK, that sounds simple.

I suppose, then, that I will
  1. Disconnect any clients using the systems
  2. Shut down the current primary
  3. Update DNS to point the current primary name at the secondary
  4. Turn off the readonly flag on the secondary
  5. Re-create on the old secondary the sharing (NFS, SMB) that existed in the old primary
  6. Re-connect any clients with the secondary (new primary)
  7. Once all is well, re-create a secondary on the former primary and start replications
 

I0nize

Cadet
Joined
Aug 18, 2014
Messages
5
OK, that sounds simple.

I suppose, then, that I will
  1. Disconnect any clients using the systems
  2. Shut down the current primary
  3. Update DNS to point the current primary name at the secondary
  4. Turn off the readonly flag on the secondary
  5. Re-create on the old secondary the sharing (NFS, SMB) that existed in the old primary
  6. Re-connect any clients with the secondary (new primary)
  7. Once all is well, re-create a secondary on the former primary and start replications

That's essentially what I did and I had no issues. You can re-create your shares beforehand, they will just be read only until that flag is switched off.
 

hokan

Dabbler
Joined
Feb 10, 2017
Messages
42
It seems to have worked. Here's what I just did, with a few notes.

  • Disconnect any clients (NFS, SMB) using the systems.
  • turn off periodic snapshots on the current primary and perform one last snapshot and replication. How do I make that final replication happen? Something to figure out for the future.
  • Update the name by which the current primary knows itself, then shut down the current primary.
  • Update the name by which the current secondary knows itself, then shut down the current secondary.
  • Update DNS to swap the host names.
  • Start both systems
  • Turn off the readonly flag on the secondary. Not needed -- was not set. I see other references in these forums to this flag being set for replicants. I wonder why it wasn't set for me?
  • Re-create on the old secondary the sharing (NFS, SMB) that existed in the old primary. For the future: these could be kept in sync on both systems, perhaps disabled where unneeded.
  • Re-connect any clients with the FreeNAS systems
  • Once all is well, re-create a secondary on the former primary and start replications. Note to self: I need to update ipfw rules to permit semi-auto configuration via 443.
  • For just a swap (rather than disaster recovery) the replication process seemed to be OK with the system swap. Still, for my comfort, in a few days I'll remove and re-create the datasets on the new secondary.
  • Update the name tags on the hardware.
This was an important exercise for me to understand what we will have to do in the case of a disaster. So far it's looking like we'll handle that disaster just fine, at least for the FreeNAS systems.
 
Last edited:

cdiddy

Dabbler
Joined
Oct 3, 2017
Messages
39
So is it safe to assume that if i have replicated a pool to secondary physical volume, I can destroy my original volume, rebuild it, replicate the data back to the new primary from the secondary, and i will be back up and running? I have read through the docs, and read a few dozen posts about this topic, and this is my first time needing to restore from backup so I am quite nervous to pull the trigger. In case it matters, my .system is on a separate physical volume from either of the two i've been describing here.
 

hokan

Dabbler
Joined
Feb 10, 2017
Messages
42
Yes, this is what I did.

My need was twofold: First, my primary and secondary are in different buildings and, for network effeciencey, we decided that the primary needed to be where the secondary was. We could have simply swaped the computers but my second need was to confirm my ability to recover from a disaster.

Note that some configuration things on the secondary may not be the same and so will need updating, for example I needed to go over all the sharing to duplicate what I had on the old primary.
 
Status
Not open for further replies.
Top