Madhuri
Madhuri

Reputation: 77

why is cassandra not getting connected to server?

I have installed cassandra and worked on it. It worked properly. Now, it is showing as-

localhost/<> is in use by another process. Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services Fatal configuration error; unable to start server. See log for stacktrace. INFO 09:17:02 Announcing shutdown INFO 09:17:02 Compacted 4 sstables to [./../data/data/system/local-7ad54392bcdd35a684174e047860b377/system-local-ka-33,]. 6,485 bytes to 5,751 (~88% of original) in 223ms = 0.024595MB/s. 4 total partitions merged to 1. Partition merge counts were {4:1, } INFO 09:17:04 Waiting for messaging service to quiesce user@inblrlt-user:~/dev/Cassandra/apache-cassandra-2.1.7/bin$ ./cqlsh Connection error: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=None, last_host=None',)})

How to change my server address so that the issue is cleared?

Upvotes: 1

Views: 385

Answers (1)

Anower Perves
Anower Perves

Reputation: 762

Your localhost is already in use. Follow the following steps-

$ jps

You see some processes running. For example:

9107 Jps 1112 CassandraDaemon

Then kill the CassandraDaemon process by the process id you see after executing jps. In my example, here process id 1112 for CassandraDaemon.

$ kill -9 1112

Then check processes again after a while-

$ jps

You will see CassandraDaemon will no longer be available.

9170 Jps

Then remove your saved_caches and commilog and start cassandra again.

If you want to change the listen_address from localhost to any private ip or public ip, you need to make the following changes:

  1. change seeds: at cassandra.yaml
  2. change listen_address: at cassandra.yaml
  3. change rpc_address: at cassandra.yaml
  4. set JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<place_your_ip_here>" at cassandra-env.sh

Upvotes: 1

Related Questions