Adding a datacenter to a single-token architecture cluster
Steps for adding a datacenter to single-token architecture clusters, not vnodes.
Steps for adding a datacenter to single-token architecture clusters, not vnodes.
Procedure
- Ensure that you are using NetworkTopologyStrategy for all keyspaces.
-
For each new node, edit the configuration properties in the
cassandra.yaml file:
- Set
auto_bootstrap
toFalse
. - Set the
initial_token
. Be sure to offset the tokens in the new datacenter, see Generating tokens. - Set the
cluster name
. - Set any other non-default settings.
- Set the seed lists. Every node in the cluster must have the same list of seeds and include at least one node from each datacenter. Typically one to three seeds are used per datacenter.
- Set
-
Update either the properties file on all nodes to include the new nodes. You do
not need to restart.
- GossipingPropertyFileSnitch: cassandra-rackdc.properties
- PropertyFileSnitch: cassandra-topology.properties
- Ensure that your client does not auto-detect the new nodes so that they aren't contacted by the client until explicitly directed.
- If using a QUORUM consistency level for reads or writes, check the LOCAL_QUORUM or EACH_QUORUM consistency level to make sure that the level meets the requirements for multiple datacenters.
- Start the new nodes.
-
The
GossipingPropertyFileSnitch
always loads cassandra-topology.properties when that file is present. Remove the file from each node on any new cluster or any cluster migrated from thePropertyFileSnitch
. -
After all nodes are running in the cluster:
- Change the replication factor for your keyspace for the expanded cluster.
- Run nodetool rebuild on each node in the new datacenter.
The location of the cassandra-rackdc.properties file depends on the type of installation:Cassandra package installations /etc/cassandra/cassandra-rackdc.properties Cassandra tarball installations install_location/conf/cassandra-rackdc.properties The location of the cassandra-topology.properties file depends on the type of installation:Cassandra package installations /etc/cassandra/cassandra-topology.properties Cassandra tarball installations install_location/conf/cassandra-topology.properties The location of the cassandra.yaml file depends on the type of installation:Cassandra package installations /etc/cassandra/cassandra.yaml Cassandra tarball installations install_location/cassandra/conf/cassandra.yaml