Search code examples
cassandracassandra-3.0jvm-hotspot

Java HotSpot(TM) Server VM warning in Cassandra


I am getting following error while running the cassandra.

$ sudo service cassandra start

$ cassandra

Java HotSpot(TM) Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied.


Solution

  • I guess you have installed the Cassandra using repositories. Cassandra needs a directory to store data and in your case, it cannot create that directories because of permission problems. You have three-way:

    1. Become the root user using the command sudo su and run the command cassandra as the root user. You can issue the command sudo systemctl enable cassandra.service to run Cassandra automatically at startup.
    2. change the following setting in cassandra.yaml file to where the user has permission, like your home directory.

      data_file_directories

      commitlog_directory

      saved_caches_directory

    3. add the line export CASSANDRA_HOME=path/to/cassandra in user .bashrc file and after that run source .bashrc to compile it. This makes Cassandra know the Cassandra install directory and creates the nesseccery folder within that.