Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting cassandra as a service does not work for 2.0.5, sudo cassandra -f works

When I try to start cassandra on ubuntu 12.04 (installed via Datastax's dsc20 package) as a service as follows :

$ sudo service cassandra start

it says

*could not access pidfile for Cassandra

& no other messages or anything in logs.

But when I try to run as a root user( sudo cassandra -f) it just works properly & cassandra is started. While trying to debug I found that when trying to run as a non-root user I was getting these messages:

ERROR 17:48:08,432 Exception encountered during startup
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
..
java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
..
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.

Is there some problem with the packaging ? Not properly installed/ configured by package ??

like image 463
Rajat Gupta Avatar asked Dec 12 '25 11:12

Rajat Gupta


1 Answers

By default the cassandra service does not and should not run as root.

My guess is you ran it in the foreground first, which automatically will create /var/lib/cassandra with root permissions instead of with the cassandra permissions. Either chown -R /var/lib/cassandra with the appropriate group and user or blow away the directory and try starting the service again.

like image 107
Ryan Svihla Avatar answered Dec 15 '25 05:12

Ryan Svihla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!