Database Reference
In-Depth Information
Changing the Cluster Name
Cassandra clusters are given names in order to prevent machines in one cluster from joining an-
other that you don't want them to be a part of. The name of the default cluster in the config file
is “Test Cluster”. You can change the name of the cluster by updating the <ClusterName> ele-
ment—just make sure that you have done this on all nodes that you want to participate in this
cluster.
NOTE
If you have written data to an existing Cassandra cluster and then change the cluster name, Cassandra
will warn you with a cluster name mismatch error as it tries to read the datafiles on startup, and then it
will shut down.
Adding Nodes to a Cluster
The configuration file has an element that is set to false by default. Say that you have been run-
ning a cluster or a single node and added data to it, and now you want to introduce more nodes to
the cluster. You can do this using the autobootstrap element. I have a single Cassandra server
running on an IP ending in 1.5, as shown by NodeTool:
$ bin/nodetool -h 192.168.1.5 ring
Address Status Load Range Ring
192.168.1.5 Up 433.43 MB 126804671661649450065809810549633334036 |<--|
This server has its own address as a seed. We leave autobootstrap set to false, because this node
is acting as a seed. If you want to add a new seed node, then you should autobootstrap it first,
and then change it to a seed afterward. For node B to use node A as a seed, node B needs to
reference node A as its seed in its configuration file. But node A does not have to declare itself
as a seed.
Now I'd like to add another node to share the load. This node's address ends in 1.7. First, make
sure that the nodes in the cluster all have the same name and the same keyspace definitions so
that the new node can accept data. Edit the config file on the second node to indicate that the
first one will act as the seed. Then, set autobootstrap to true.
When the second node is started up, it immediately recognizes the first node, but then sleeps for
90 seconds to allow time for nodes to gossip information about how much data they are storing
locally. It then gets the bootstrap token from the first node, so it knows what section of the data
it should accept. The bootstrap token is a token that splits the load of the most-loaded node in
half. Again, the second node sleeps for 30 seconds and then starts bootstrapping.
Search WWH ::




Custom Search