Cluster consistency
This page describes how to manage the cluster nodes of a strong consistency (SC) namespace in the Aerospike Database.
Add nodes to the cluster and roster
[Use the asadm manage roster & show roster
commands. Otherwise, use the equivalent asinfo - roster and asinfo - roster-set commands.
-
Install and configure Aerospike on the new nodes as described in Configure strong consistency.
-
When the nodes have joined the cluster, use the following command to verify that the result in
cluster_sizeis greater than the result inns_cluster_size. This is visible in the following output wherecluster_sizeshows 6 rows, while ns_cluster_size shows 5 rows.Terminal window Admin> show stat -flip like cluster_size~Service Statistics (2021-10-22 23:43:35 UTC)~Node|cluster_sizenode1.aerospike.com:3000| 6node2.aerospike.com:3000| 6node4.aerospike.com:3000| 6node5.aerospike.com:3000| 6node6.aerospike.com:3000| 6node7.aerospike.com:3000| 6Number of rows: 6~test Namespace Statistics (2021-10-22 23:43:35 UTC)~Node|ns_cluster_sizenode1.aerospike.com:3000| 5node2.aerospike.com:3000| 5node4.aerospike.com:3000| 5node5.aerospike.com:3000| 5node6.aerospike.com:3000| 5node7.aerospike.com:3000| 5Number of rows: 6 -
Use
show rosterto see the newly observed nodes in its Observed Nodes section. -
Use the following command to copy the
Observed Nodeslist into thePending Roster.Terminal window Admin> enableAdmin+> manage roster stage observed ns testPending roster now contains observed nodes.Run "manage recluster" for your changes to take affect. -
Activate the new roster with the
manage reclustercommand.Terminal window Admin+> manage reclusterSuccessfully started recluster -
Run
show rosterto confirm that the roster has been updated on all nodes. Verify that the service’scluster_sizematches the namespace’sns_cluster_size.
Remove nodes and update the roster
This section describes how to remove a node from an existing namespace configured with SC.
Remove node from the cluster
-
Run
show roster. Verify all roster nodes are present in the cluster.Terminal window Admin+> pager onAdmin+> show roster~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Roster (2021-10-23 00:08:54 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Node | Node ID | Namespace| Current Roster | Pending Roster | Observed Nodesnode1.aerospike.com:3000 |BB9070016AE4202 | test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node3.aerospike.com:3000 |BB9060016AE4202 | test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node4.aerospike.com:3000 |BB9050016AE4202 | test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node5.aerospike.com:3000 |BB9040016AE4202 | test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node6.aerospike.com:3000 |BB9010016AE4202 | test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node7.aerospike.com:3000 |*BB9020016AE4202| test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202 |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202Number of rows: 6 -
Shut down safely the nodes to be removed with the following command (in this example on
node1.aerospike.com:3000with node idBB9070016AE4202). Verify you are removing fewer nodes that your configured RF.Terminal window systemctl stop aerospike -
When migrations are complete, run the
statcommand onpartitions_remaininguntil themigrate_partitions_remainingstat becomes zero on all nodes.Terminal window Admin> show stat service like partitions_remaining -flip~~~~~Service Statistics (2021-10-23 00:25:10 UTC)~~~~Node|migrate_partitions_remainingnode2.aerospike.com:3000| 0node4.aerospike.com:3000| 0node5.aerospike.com:3000| 0node6.aerospike.com:3000| 0node7.aerospike.com:3000| 0Number of rows: 5
Remove node from the roster
-
Run
show rosterto verify that BB9070016AE4202 is removed from the pending roster. In the following example there is one fewer node in theObserved Nodescolumn than inCurrent RosterandPending Roster.Terminal window Admin+> pager onAdmin+> show roster~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Roster (2021-10-23 00:26:56 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Node| Node ID|Namespace| Current Roster| Pending Roster| Observed Nodesnode1.aerospike.com:3000|BB9070016AE4202 |test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node3.aerospike.com:3000|BB9060016AE4202 |test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node4.aerospike.com:3000|BB9050016AE4202 |test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node5.aerospike.com:3000|BB9040016AE4202 |test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node6.aerospike.com:3000|BB9010016AE4202 |test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202node7.aerospike.com:3000|*BB9020016AE4202|test |BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9070016AE4202,BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202|BB9060016AE4202,BB9050016AE4202,BB9040016AE4202,BB9020016AE4202,BB9010016AE4202Number of rows: 6 -
Copy the
Observed Nodeslist into thePending Roster.Terminal window Admin+> manage roster stage observed ns testPending roster now contains observed nodes.Run "manage recluster" for your changes to take affect. -
Run
manage reclusterto apply the change.Terminal window Admin+> manage reclusterSuccessfully started recluster -
Check if startup is complete. Run the following command periodically until it returns
ok.Terminal window asinfo -h [ip of host] -v 'status'
Validate partitions
When you validate partitions, each node reports the global number of dead or unavailable partitions. For example, if the entire cluster has determined that 100 partitions are unavailable, all of the current nodes report 100 unavailable partitions.
- Use the following command to display which nodes report dead or unavailable partitions.
show stat namespace for <ns> like 'unavailable|dead' -flip-
In the output of this command, the columns
unavailableanddeadshould be 0 for each node.Terminal window Admin> show stat namespace for test like 'unavailable|dead' -flip~~~~~~test Namespace Statistics (2021-10-23 00:36:43 UTC)~~~~~~~Node|dead_partitions|unavailable_partitionsnode1.aerospike.com:30000| 0| 0node2.aerospike.com:30000| 0| 0node4.aerospike.com:30000| 0| 0node5.aerospike.com:30000| 0| 0node6.aerospike.com:30000| 0| 0Number of rows: 5
Revive dead partitions
You may wish to use your namespace in spite of potentially missing data. For example, you may have entered a maintenance state where you have disabled application use, and are preparing to reapply data from a reliable message queue or other source.
-
Identify dead partitions.
Terminal window Admin> show stat namespace for test like dead -flip~test Namespace Statistics (2021-10-23 00:38:41 UTC)~Node|dead_partitionsnode1.aerospike.com:3000| 264node2.aerospike.com:3000| 264node4.aerospike.com:3000| 264node5.aerospike.com:3000| 264node6.aerospike.com:3000| 264Number of rows: 5 -
Run
reviveto acknowledge the potential data loss on each server.Terminal window Admin+> manage revive ns test~~~Revive Namespace Partitions~~~Node|Responsenode1.aerospike.com:3000|oknode2.aerospike.com:3000|oknode4.aerospike.com:3000|oknode5.aerospike.com:3000|oknode6.aerospike.com:3000|okNumber of rows: 5 -
Run
reclusterto revive the dead partitions.Terminal window Admin+> manage reclusterSuccessfully started recluster -
Verify that there are no longer any dead partitions with the
dead_partitionsmetric.Terminal window Admin> show stat namespace for test like dead -flip~test Namespace Statistics (2021-10-23 00:40:41 UTC)~Node|dead_partitionsnode1.aerospike.com:3000| 0node2.aerospike.com:3000| 0node4.aerospike.com:3000| 0node5.aerospike.com:3000| 0node6.aerospike.com:3000| 0Number of rows: 5