topology

Encapsulates commands that manipulate store topologies. Examples are redistribution/rebalancing of nodes or changing replication factor. Topologies are created and modified using this command. They are then deployed by using the plan deploy-topology command. For more information, see plan deploy-topology. The subcommands are as follows:

topology change-repfactor

topology change-repfactor -name <name>  -pool <pool name>
    -zn <id> | -znname <name> -rf <replication factor> 

Modifies the topology to change the replication factor of the specified zone to a new value. The replication factor may be decreased for secondary zones, but decreasing it for primary zones is not currently supported.

When increasing the replication factor, the command may create Replication Nodes or Arbiter Nodes and may remove Arbiter Nodes only in the zone specified in the command. If the change in replication factor increases the total primary replication factor equal to two and the zone is configured to allow Arbiters, then Arbiters are created in that zone. If the change in replication factor increases the total primary replication factor from two to a number greater than two and if the zone contained Arbiters, then the Arbiters are removed from the zone. If some other zone contained Arbiters, a topology rebalance must be performed to remove the Arbiters from the topology.

For more information on increasing the replication factor, see Increase Replication Factor.

When decreasing the replication factor for a secondary zone, the command will remove the replication nodes from the zone.

If you want to remove a secondary zone, then the replication factor for that secondary zone should be reduced to zero.

After reducing the replication factor to zero, do the following steps to remove the secondary zone:
  1. Remove any admins in the zone using plan remove-admin command
  2. Remove the Storage Nodes in the zone using plan remove-sn command
  3. Remove the zone using plan remove-zone command

topology change-zone-arbiters

topology change-zone-arbiters -name <name>
    {-zn <id> | -znname <name>}  {-arbiter | -no-arbiter}

Modifies the topology to change the Arbiter Node attribute of the specified zone.

topology change-zone-master-affinity

topology change-zone-master-affinity -name <name>
    -zn <{-no-master-affinity | -master-affinity} 

Modifies the topology of the existing specified zone to –no-master-affinity, or to –master-affinity. For example:

topology change-zone-master-affinity -name new-topo -zn zn1 -no-master-affinity

Use this command after initially deploying a topology (plan deploy-zone).

topology change-zone-type

topology change-zone-type -name <name>
    {-zn <id> | -znname <name>} -type {primary | secondary} 

Modifies the topology to change the type of the specified zone to a new type.

If one or more zones have their type changed and the resulting topology is deployed using the plan deploy-topology command, the following rules apply:

  • The plan waits for up to five minutes for secondary nodes that are being converted to primary nodes to catch up with their masters.

  • The plan will fail, and print details about lagging zones and nodes, if a quorum of secondary nodes in each shard fails to catch up within the required amount of time. This behavior helps to reduce the time that a newly added primary node cannot become a master, and so is not able to contribute to availability.

  • Because this command can only be performed successfully if quorum can be maintained, it does not result in data loss.

topology clone

topology clone -from <from topology> -name <to topology>

or

topology clone -current -name <to topology> 

Clones an existing topology so as to create a new candidate topology to be used for topology change operations.

topology contract

topology contract -name <name> -pool <pool name>

Modifies the named topology to contract storage nodes. For more information, see Contracting a Topology.

topology create

topology create -name <candidate name> -pool <pool name> [-json] 
    -partitions <num>

Creates a new topology with the specified number of partitions using the specified storage pool.

You should avoid using the dollar sign ('$') character in topology candidate names. The CLI displays a warning when trying to create or clone topologies whose names contain the reserved character.

If the primary replication factor is equal to two, the topology create command will allocate Arbiter Nodes on the Storage Nodes in a zone that supports hosting Arbiter Nodes. During topology deployment, an error is issued if there are not enough Storage Nodes for Arbiter Node distribution. A valid Arbiter Node distribution is one in which the Arbiter Node is hosted on a Storage Node that does not contain other members of its Replication Group.

For more information on creating the first topology candidate, see Make the Topology Candidate.
kv-> topology create -name mytopo -pool snpool -json -partitions 20
{
	"operation" : "topology create",
	"returnCode" : 5000,
	"description" : "Operation ends successfully",
	"returnValue" : {
		"store" : "mystore",
		"numPartitions" : 20,
		"sequence" : 32,
		"zone" : [ {
		"id" : "zn1",
		"name" : "1",
		"repfactor" : 1,
		"type" : "PRIMARY"
		}, {
	"id" : "zn2",
	"name" : "2",
	"repfactor" : 1,
	"type" : "PRIMARY"
	}, {
	"id" : "zn3",
	"name" : "3",
	"repfactor" : 1,
	"type" : "PRIMARY"
	} ],
	"sns" : [ {
	"id" : "sn1",
	"zone_id" : "zn1",
	"host" : "localhost",
	"port" : 20000,
	"capacity" : 1,
	"rns" : [ "rg1-rn1" ],
	"ans" : [ ]
	}, {
	"id" : "sn2",
	"zone_id" : "zn2",
	"host" : "localhost",
	"port" : 21000,
	"capacity" : 1,
	"rns" : [ "rg1-rn2" ],
	"ans" : [ ]
	}, {
	"id" : "sn3",
	"zone_id" : "zn3",
	"host" : "localhost",
	"port" : 22000,
	"capacity" : 1,
	"rns" : [ "rg1-rn3" ],
	"ans" : [ ]
	} ],
	"shards" : [ {
		"id" : "rg1",
		"numPartitions" : 20,
		"rns" : [ "rg1-rn1", "rg1-rn2", "rg1-rn3" ],
		"ans" : [ ]
		} ],
	"name" : "mytopo"
	}
}

topology delete

topology delete -name <name> 

Deletes a topology.

topology list

topology list 

Lists existing topologies.

topology preview

topology preview -name <name> [-start <from topology>]

Describes the actions that would be taken to transition from the starting topology to the named, target topology. If -start is not specified, the current topology is used. This command should be used before deploying a new topology.

topology rebalance

topology rebalance -name <name> -pool <pool name>
    [-zn <id> | -znname <name>]

Modifies the named topology to create a balanced topology. If the optional -zn flag is used, only Storage Nodes from the specified zone are used for the operation.

This command may also add, move or remove Arbiter Nodes. Arbiter Nodes are added if the new topology supports Arbiter Nodes and the old topology does not. Arbiter Nodes are removed if the old topology supported Arbiter Nodes and the new one does not. Arbiter Nodes may be moved to a zero Replication Factor datacenter if the Arbiter Nodes are hosted in a non zero Replication Factor datacenter.

For more information on balancing a non-compliant topology, see Balance a Non-Compliant Topology.

topology redistribute

topology redistribute -name <name> -pool <pool name> 

Modifies the named topology to redistribute resources to more efficiently use those available.

For more information on redistributing resources to enhance write throughput, see Increase Data Distribution.

topology validate

topology validate [-name <name>] 

Validates the specified topology. If no topology is specified, the current topology is validated. Validation generates violations and notes.

Violations are issues that can cause problems and should be investigated.

Notes are informational and highlight configuration oddities that can be potential issues or may be expected.

For more information, see Validate the Topology Candidate.

topology view

topology view -name <name> 

Displays details of the specified topology. Also displays any available Arbiter Node information.