n is either primary, backup, or auto.
ShardMirrorMember configures mirrored cluster nodes by assigning failover roles to individual nodes. The value specified for ShardMirrorMember determines the failover role of the instance as follows:
primary — The instance is configured or deployed as the primary of a data node mirror. If ShardRole is set to NODE1, it becomes the primary of the node 1 mirror; if set to DATA, it becomes the primary of a data node other than node 1.
backup — The instance is configured or deployed as the backup to the primary identified by ShardClusterURL.
auto — The instance’s mirror role is based on the hostnames of the nodes on which the instances are deployed, as follows:
If the integer following the final hyphen (-) in the hostname is even, the instance is configured as a primary, and if odd, as a backup.
If ShardMasterRegexp has a value, the instance on the host with a name matching the regular expression specified by it is configured or deployed as the node 1 primary and the remaining nodes are configured or deployed according to the hostname pattern.
Using This Parameter
In conjunction with other parameters, ShardMirrorMember can be used to deploy sharded clusters, mirrored or nonmirrored, using the configuration merge feature.
Typically, this parameter would not be changed after deployment of the sharded clusterOpens in a new tab, unless the instance is removed from the cluster.
ArbiterURL, to identify the arbiter used by the data node mirror the instance is a member of.
ShardRole, to specify the sharded cluster role of the instance.
ShardClusterURL to specify the node to use as a template when adding an instance to a sharded cluster.
ShardMasterRegexp, to identify the sharded cluster node to be configured as data node 1 based on hostname.
ShardRegexp, to identify the nodes to be configured as sharded cluster data nodes (other than data node 1) based on hostname.