replica-set

Adds a member to a database replica set. A replica-set is a group of devices (replica-set members) running the database instances that maintain the same data set. Replica sets provide redundancy and high availability and are the basis for all production deployments. The replica set usually consists of: an arbiter, a primary member, and one or more secondary members. The primary member and the secondary member(s) maintain replicas of the data set.
Before deploying a replica set, ensure that each of the replica-set member:
  • has the DB instances installed, and
  • is able to communicate with every other member in the set.
After ensuring the above,
  • Create a database policy (with identical replica-set configuration) on each of the member devices, and
  • Use the database policy in the member device‘s configuration mode.

These member devices elect a primary member, which begins accepting client-write operations. Remaining devices in the replica-set, with the exception of the arbiter, are designated as secondary members.

Supported in the following platforms:

Syntax

replica-set member [<IP>|<FQDN>] {arbiter|priority <0-255>}

Parameters

replica-set member [<IP>|<FQDN>] {arbiter|priority <0-255>}
replica-set member [<IP>|<FQDN>] {arbiter|priority <0-255>} Adds a member to the database replica set. To identify the member, use one of the following options:
  • <IP> – Specify the member‘s IP address.
  • <FQDN> – Specify the member‘s FQDN.
After specifying the IP address or FQDN, specify the following:
  • arbiter – Optional. Select to configure the member as the arbiter.
  • priority <0-255> – Optional. Configures the priority of a non-arbiter member of the replica set
    • <0-255> – Specify the priority from 0 - 255. This value determines the member‘s position within the replica set as primary or secondary. It also helps in electing the fall-back primary member in the eventuality of the current primary member being unreachable.

A replica set should have at least three members. The maximum number of members can go up to fifty (50). However, configuring a three-member replica set is recommended. Replica sets should have odd number of members. In case of an even-numbered replica set, add an arbiter to make the member count odd. This ensures that at least one member gets a majority vote in the primary-member election.

Examples

nx9500-6C874D(config-database-policy-test)#replica-set member 192.168.13.14 arbiter
nx9500-6C874D(config-database-policy-test)#replica-set member 192.168.13.16 priority 1
nx9500-6C874D(config-database-policy-test)#replica-set member 192.168.13.12 priority 2
nx9500-6C874D(config-database-policy-test)#show context
database-policy test
 replica-set member 192.168.13.12 priority 2
 replica-set member 192.168.13.14 arbiter
 replica-set member 192.168.13.16 priority 1
nx9500-6C874D(config-database-policy-test)#

Related Commands

no Removes a member from the database replica set