What do /var/log files serve for?When I try to run cassandra on my Ubuntu 16.04

OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied


19:47:58,887 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - Active log file name: /var/log/cassandra/system.log
19:47:58,887 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - File property is set to [/var/log/cassandra/system.log]
19:47:58,889 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
    at java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)

Why do I have these problems? This is my java

java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

These are the permissions

/var/log$ ls -la cassandra/
total 300
drwxr-xr-x  2 cassandra cassandra   4096 jan.  25 15:50 .
drwxrwxr-x 14 root      syslog      4096 jan.  25 15:49 ..
-rw-r--r--  1 cassandra cassandra 184448 jan.  25 19:50 debug.log
-rw-r--r--  1 cassandra cassandra  59956 jan.  25 19:50 gc.log.0.current
-rw-r--r--  1 cassandra cassandra  41363 jan.  25 19:50 system.log

I was facing the same issue, fixed using following commands:

sudo chown -R $USER:$GROUP /var/lib/cassandra/

sudo chown -R $USER:$GROUP /var/log/cassandra/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.