How to configure permissions for Cassandra on Linux Ubuntu

Thanks for this. I am stuck on the third step in this tutorial regarding installing Cassandra: http://wiki.apache.org/cassandra/GettingStarted#Step_3:_Start_Cassandra

I can only run this software with root privileges. (shouting this because of the fictional noise of a helicopter) This seems like a terrible way to run software.

When starting the Cassandra server as a regular user, I get the following errors:

1.) 15:46:00,147 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied) 15:46:00,147 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)

2.) ERROR 20:46:00 Doesn't have write permissions for /var/lib/cassandra/data directory

I tried changing permissions several times and nothing worked. I tried changing the read / write permissions of /var/log/cassandra/system.log for the cassandra group on the operating system (OS). The command I used for this was sudo chmod 664 /var/log/cassandra/system.log . I found this page useful in determining how to change permissions: http://www.linux.org/threads/file-permissions-chmod.4094/

Then I added my username to the cassandra group. From my understanding, running the command /usr/sbin/cassandra -f , since my user must allow me access to the file /var/log/cassandra/system.log , which would allow one of the errors, error number 1 is higher.

reverence

user

+5
source share
2 answers

I have found a solution! I ran sudo -u cassandra /usr/sbin/cassandra -f and then ran into problems in the commitlog directory that commitlog mentions in his answer. Then I ran the recursive chown Phact command, sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog , and the Cassandra server started correctly, as if I were running the program as root: D: D: D

+6
source

Grant the user rights to access data and logging goals.

 sudo chown -R cassandra:cassandra /var/lib/cassandra/data sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog 
+8
source

Source: https://habr.com/ru/post/1233384/


All Articles