LetsNoSQL
LetsNoSQL

Reputation: 1538

IP swapping in Cassandra cluster

We have healthy running 3 nodes cassandra cluster but we need to swap all 3 nodes IP address due to some issue.

So basically, we want to swap old cassandra server IP address from to new cassandra server IP address. My question is :-

1) Is there any specific procedure we need to follow to avoid any issue?

2) Or Just modify rpc_address, listen_address, seeds, peers table etc. and start the cassandra nodes?

Please help, Thanks

Upvotes: 2

Views: 2891

Answers (1)

Carlos Monroy Nieblas
Carlos Monroy Nieblas

Reputation: 2283

You have already identified most of the steps to take. Also, ensure to follow the steps one node at a time:

  1. in cassandra.yaml update rpc_address, listen_address, seeds, and any reference to the previous IP address. Also, ensure that auto_bootstrap is set to false (by default the directive is omitted and the default value is true).
  2. Depending on your installation, also look in cassandra-topology.properties and cassandra-rackdc.properties
  3. Stop the cassandra service
  4. Change the IP address of the box (i.e. ifconfig, add the new route, etc.)
  5. in cassandra-env.sh include the following directive with the previous IP address: JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=previous_ip_address
  6. Start the Cassandra service in the node. Wait until nodetool status reports it as UN, you should notice that the new IP address is reported
  7. If you added the auto_bootstrap directive in cassandra.yml, remove it\
  8. remove the cassandra.replace_address directive from cassandra-env.sh
  9. repeat in a different node

Upvotes: 3

Related Questions