I was trying to set up a five node Cassandra cluster in Ubuntu 12.04. Upon a successful installation of Cassandra following the steps outlined at here, and updating /etc/cassandra/cassandra.yaml on all the nodes based on the information provided in the, ‘Initializing a Multi-Node or Multi-Data Center Cluster‘ section of the Cassandra documentation, I was frustrated to find that Cassandra failed to start.
Upon analyzing the logs (/var/log/cassandra/system.log), it was evident that Cassandra did not start due to an exception, "Fatal exception during initialization org.apache.cassandra.config. ConfigurationException: Saved cluster name Test Cluster != configured name...".
Searching for few hours, I finally boiled down to a solution which has been explained clearly at: http://mail-archives.apache.org/mod_mbox/cassandra-user/201208.mbox/%3C5020B7AD.6060405@orkash.com%3E.
In summary, the issue came into existence as Cassandra was automatically started upon a successful installation with the default configuration. The default configuration had set the ‘cluster_name‘ as ‘Test Cluster‘ in the system keyspace as this is the default name mentioned in /etc/cassandra/cassandra.yaml. Every time Cassandra is restarted, it compares the value of the ‘cluster_name‘ as listed in the the configuration file and the one mentioned in the system keyspace . The here-to-fore mentioned exception is flagged if the values don’t match.
A quick fix for me was to delete the files in the system keyspace folder excluding those whose name resembles, ‘Schema*.*‘, as suggested by in apache-cassandra-mail-archive. Note that I had no data to loose as this was a brand new cluster setup. In case you are facing a similar issue in your existing cluster with pre-existing date, it is not recommended to use this fix. Please backup your existing data before attempting modifications like these.
References:
Hi, these steps are safe to perform on a cluster without losing your data: http://wiki.apache.org/cassandra/FAQ#clustername_mismatch