0
votes

I have cloud server which is having CentOS 7 installed. I have installed Apache Cassandra 3.7 on it yesterday. I was able to access Cassandra using cqlsh yesterday but today when I am trying to access it using cqlsh it gives me error like below :

Blockquote Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")}) Blockquote

below is the details of cassandra.log

Blockquote

INFO  06:45:53 Initializing system_schema.keyspaces
INFO  06:45:53 Initializing system_schema.tables
INFO  06:45:53 Initializing system_schema.columns
INFO  06:45:53 Initializing system_schema.triggers
INFO  06:45:53 Initializing system_schema.dropped_columns
INFO  06:45:53 Initializing system_schema.views
INFO  06:45:53 Initializing system_schema.types
INFO  06:45:53 Initializing system_schema.functions
INFO  06:45:53 Initializing system_schema.aggregates
INFO  06:45:53 Initializing system_schema.indexes
INFO  06:45:53 Not submitting build tasks for views in keyspace system_schema as storage service is not initialized
ERROR 06:45:54 Failed to create /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453 directory
ERROR 06:45:54 Exiting forcefully due to file system exception on startup, disk failure policy "stop"
org.apache.cassandra.io.FSWriteError: java.io.IOException: Failed to mkdirs /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453
    at org.apache.cassandra.io.util.FileUtils.createDirectory(FileUtils.java:365) ~[apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.db.Directories.<init>(Directories.java:241) ~[apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.db.ColumnFamilyStore.scrubDataDirectories(ColumnFamilyStore.java:601) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:264) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:585) [apache-cassandra-3.7.0.jar:3.7.0]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:714) [apache-cassandra-3.7.0.jar:3.7.0]
Caused by: java.io.IOException: Failed to mkdirs /var/lib/cassandra/data/test/merchant-f0892c606e6611e69252716e565c6453
    ... 6 common frames omitted

Blockquote

I have also changed listen_address and rpc_address to my local IP, public_ip and 127.0.0.1 but dont get connected

Thanks

2

2 Answers

1
votes

I think its an error related to user persmission.Try below.It can be also a script conflict.

sudo chown -R cassandra:cassandra /var/lib/cassandra/data/test

OR

sudo chown -R cassandra:cassandra /var/lib/cassandra/data/


sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog.

Any ways try to start cassandra as root

Also try to close cassandra service normally before You shutdown.

like ..

$ ps auwx | grep cassandra
$ sudo kill pid

OR

sudo service cassandra stop
1
votes

Thanks it worked by only using
chown -R cassandra:cassandra /var/lib/cassandra/data/