How do I add a strong consistency namespace to an existing cluster?


#1

Title

How do I add a strong consistency namespace to an existing cluster?

Problem Description

I have a cluster that needs to have a strong consistency enabled namespace added to it.

Explanation

Aerospike server version 4.0 introduces a new mode for configuring a namespace with strong consistency (vs. default of AP). Refer to the Strong Consistency Guide for details about this mode. In order to add a namespace that is AP enabled, please see this knowledge-base article on adding namespace. For a strong consistency namespace, you would need to follow the steps below in order to have the cluster configured correctly.

Solution

Part 1: Add Namespace

  1. Edit the aerospike.conf file to contain the new strong consistency namespace. If you have a rack-aware enabled cluster, you would need to add rack-id as well to the configuration.
namespace <ns_name> {
  ---
	strong-consistency true
  ---
}

Configuration reference to strong consistency.

  1. Stop the Aerospike service
sudo service aerospike stop
  1. Start the Aerospike service
sudo service aerospike start

Make sure the node has joined the cluster prior to proceeding to the next step.

  1. Repeat steps 1-3 for each node in the cluster in a rolling manner. You usually do not need to wait for migrations to complete between each restart (unless if some namespaces are configured as storage-engine memory, or if the use case requires deleting the stored data whenever a node leaves the cluster (for example if records are potentially non durably deleted while a node is out of the cluster).

Part 2 - Create the Roster

  1. From within asadm, get the list of nodes with the namespace definition
Admin> asinfo –v "roster:namespace=<ns_name>"

Details on roster command.

  1. Set the roster to the observed_nodes
Admin> asinfo –v "roster-set:namespace=<ns_name>;nodes=[observed nodes list]"
The observed nodes list is an actual list of node names displayed as a result of the command from step 2 in this section

Details on roster-set command

Note for rack aware: In order to maintain the configured rack aware setting you need to append @rack-id to each node-id (as displayed in the observed node list).

Admin> asinfo –v "roster-set:namespace=<ns_name>;nodes=<node name>@101,<node name>@102,<node name>@101,…"
The rack-id numbers listed above will be taking effect. The rack-id setting in the aerospike.conf file associated with each node is only used to populate the observed node list and facilitate the creation of the roster but is otherwise not used.
  1. Validate your roster
Admin> asinfo –v "roster:"
Notice that the roster is null but pending_roster is set with the provided list of nodes.
  1. Apply the pending_roster (Only the principal will respond with “ok” to this command, the rest will ignore it).
Admin> asinfo –v "recluster:"

Details on recluster command

  1. Verify that the new roster was applied
Admin> asinfo –v "roster:"
  1. Validate that the namespace cluster size agrees with the service cluster size
Admin> show stat –flip like cluster_size

Notes

Documentation reference for Strong consistency

Keywords

strong consistency SC add namespace roster

Timestamp

05/18/2018


How do I rename an existing namespace in an Aerospike cluster?
Remove Namespace: Removing Namespace