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:

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>]

Purpose of topoplogy rebalance command

In a data store, the topology rebalance command modifies a non-compliant topology to a compliant topology state, making it a balanced topology. For a compliant topology, you must ensure that topologies follow a specific set of rules. For more information, see Determining Your Store’s Configuration.

The arguments for the topology rebalance command include:

If there are any changes made to the physical characteristics of the data store, it could become unbalanced, for example:

The command ensures compliance by resolving violations and notes arising from the physical changes. It adds, moves, or removes Arbiter Nodes and Replication Nodes. For example, the topology rebalance command:

To understand more about the scenarios in which you can use the command, see Usage of topology rebalance command.

You can verify the topology of the data store by using the verify command. For more information, see Verifying the Store.

verify configuration

Note: The topology rebalance command will not be needed when the topology is fully compliant with no changes in the physical characteristics.

Usage of topology rebalance command

When you initially deploy the data store, you establish its configuration, or topology, during setup, ensuring it meets all requirements without needing rebalancing. If there is any change in the physical characteristics of the topology, such as the store’s configuration, capacity, and so on, then:

  1. Run the verify configuration command to view any violations or verification notes.

  2. Run the topology rebalance command to fix the non-compliant topology.

Following are some of the scenarios where the use of the topology rebalance command can fix violations/verification notes and help in the transition of a non-complaint topology to a compliant topology:

The topology rebalance command resolves most of the violations to transition the non-compliant topology to a compliant topology. However, you must manually resolve some violations or verification notes for optimal results. See, Violations and Solutions table.

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.