Initializing a replica node

Before you begin

If you are adding a new replica to an existing replication set, complete the steps for backing up global data (see Preparing the primary for new replicas) and creating a replica node (see Creating replica nodes).
Important: You can take synchronized backups from any replica node, but you cannot use them for initializing or reinitializing any replica node. You can take synchronized backups for initializing or reinitializing a replica node only from the primary node.

About this task

To add a replica to the replication set, issue the following commands on each replica node.

Procedure

  1. Log in to the NPS host pod and run the nzsql command, connecting to the SYSTEM database.
  2. Verify that the node name is set:
    select * from _v_replication_mynode
  3. Restore the data on the replica node using the recovery file and set of synchronized backups from the primary:
    nzreplrestore -recoveryfile <recoveryfile>
  4. Start processing updates from the primary against replicated data by issuing the following command:
    ALTER REPLICATION NODE replset.<subordinatename> STATE ACTIVE

    At the time of initializing a new replica, the synchronized backups that are available from the primary might be too old, in the sense that intervening update transactions are no longer available from the replication queue manager. If so, perform the following steps:

    1. From the primary, issue the following commands to create a fresh recovery file and set of synchronized backups:
      nzreplanalyze -recoveryfile <recoveryfile> -set replset
      nzreplbackup -recoveryfile <recoveryfile> <backup-destination>
    2. On the replica host, issue the following command:
      nzreplrestore -recoveryfile <recoveryfile>