Nodetool Failed to connect 'Connection refused (Connection refused)'

Keywords: Cassandra - Virtual Machines - Technical issue - Other
Description:
Every time we modify /opt/bitnami/cassandra/conf/cassandra.yaml and change the cluster name the nodetool status shows ‘Connection refused’

/opt/bitnami/cassandra/logs/cassandra.log | grep ERROR
ERROR [main] 2021-03-23 20:37:05,090 CassandraDaemon.java:803 - Cannot start node if snitch’s data center (dc1) differs from previous data center (datacenter1). Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.
ERROR [main] 2021-03-23 20:38:59,891 CassandraDaemon.java:803 - Cannot start node if snitch’s data center (dc1) differs from previous data center (datacenter1). Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.
ERROR [main] 2021-03-23 21:21:07,646 CassandraDaemon.java:803 - Fatal exception during initialization
ERROR [main] 2021-03-23 21:22:59,880 CassandraDaemon.java:803 - Fatal exception during initialization

Is there another place to make additional changes? What are we missing?

Thanks!

Hello @aliciathomps,

You need to first change the cluster name in the db tables. To do so, please follow these steps considering you only have a Single Seed Node cluster:

  • Change the name in the db
$ cqlsh -u cassandra
Password: 
Connected to My Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.10 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh> UPDATE system.local SET cluster_name = 'test_name' where key='local';
cassandra@cqlsh> exit;
  • Change the name in the conf file cassandra.yaml and restart Cassandra
$ sudo vim /opt/bitnami/cassandra/conf/cassandra.yaml ## change cluster_name to test_name in file
$ sudo /opt/bitnami/ctlscript.sh restart cassandra
$ sudo /opt/bitnami/ctlscript.sh status cassandra
cassandra already running
  • Check the cluster name has been updated
$ cqlsh -u cassandra
Password: 
Connected to test_name at 127.0.0.1:9042.

Regards,
Francisco de Paz