• You are here: 
  • Home
  • Using nodetool to temporarily disable a node

Using nodetool to temporarily disable a node

Posted on February 6th, 2012

There are times when you would like a Cassandra node to stop receiving requests or appear like it is down to outside clients. You may want to use this to disable a node and adjust your log4j properties for more debugging, or your may be running some administrative action like repair or rebuildsstables and you want this action to complete as quickly as possible. Being able to disable Cassandra without shutting it down completely can be very handy.

How to do it:

Use nodetool to disable Cassandra only on a specific node.

/usr/local/apache-cassandra-1.0.7/bin/nodetool -h cassandraserver -p 8585 disablegossip
/usr/local/apache-cassandra-1.0.7/bin/nodetool -h cassandraserver -p 8585 disablethrift

How it works:

Gossip is the protocol that Cassandra nodes use to determine which nodes are UP or DOWN. Cassandra nodes gossip to each other and maintain a state of the cluster. By disabling gossip other Cassandra nodes will stop forwarding read and write requests to this node because they will believe the node is down. Client using thrift will still be able to connect to a node in this state. Disablethrift disables the client port 9160 which prevents clients from connecting to this node. Typically you will enable both disablethrift and disablegossip together.

There is more:

To re-enable gossip and thrift use the following commands:

/usr/local/apache-cassandra-1.0.7/bin/nodetool -h cassandraserver -p 8585 enablegossip
/usr/local/apache-cassandra-1.0.7/bin/nodetool -h cassandraserver -p 8585 enablethrift

Tags: , , , , ,
Filed under Chapter 7 Administration |

Leave a Reply

You must be logged in to post a comment.