0
votes

I have installed cassandra in ubuntu 18.04 successfully. When i run below command i get the following output.

sudo systemctl status cassandra

cassandra.service - LSB: distributed storage system for structured data Loaded: loaded (/etc/init.d/cassandra; generated) Active: active (exited) since Sun 2019-01-06 06:15:28 UTC; 10s ago Docs: man:systemd-sysv-generator(8) Process: 9453 ExecStop=/etc/init.d/cassandra stop (code=exited, status=0/SUCCESS)
Process: 9472 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)

Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Stopped LSB: distributed storage system for structured data. Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Starting LSB: distributed storage system for structured data... Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Started LSB: distributed storage system for structured data.

When i type cqlsh i get the below error.

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")})

I have checked logs in /var/log/cassandra/system.log. and i did not find any error logs..

Here are some of the contents inside /etc/cassandra/cassandra.yaml file

listen_address: localhost
storage_port: 7000
ssl_storage_port: 7001
start_native_transport: true
native_transport_port: 9042
start_rpc: false
rpc_address: localhost
rpc_port: 9160
rpc_keepalive: true

2

2 Answers

1
votes

The Cassandra process isn't running as you can see in the status: active (exited).

On Ubuntu 18.04 the most probable cause of this is that Ubuntu is shipped with Java 10 by default that isn't supported by existing Cassandra releases. Please install Java 8 (via sudo apt install openjdk-8-jdk) and make it as default - after that it should work.

1
votes

Change the owner of /var/lib/cassandra to cassandra:

chown cassandra:cassandra /var/lib/cassandra