Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gc.log file error when running cassandra

Tags:

cassandra

In order to install Cassandra, I've done the following: 1. Downloaded the TAR file. 2. Extracted the file. 3. Set the path for data and commitlog directories in the yaml file.

Now when I run Cassandra, I'm getting the following error: "Java HotSpot (TM) 64-Bit Server VM warning: Cannot open file. /..logs/gc.log due to No such file or directory"

What's causing this problem? Do I need to do something else before running it.

OS: RHEL 6.5 Cassandra version: 3.11.1

like image 680
Vishal Sharma Avatar asked Dec 26 '17 09:12

Vishal Sharma


People also ask

Where is Cassandra log file?

Cassandra logs are stored in the /<inst_root>/apigee/var/log/cassandra directory on each node. By default, a maximum of 50 log files, each with a maximum size of 20 MB, can be created; once this limit is reached older logs are deleted when newer logs are created.

How do I view Cassandra logs in Linux?

These logs by default live in ${CASSANDRA_HOME}/logs , but most Linux distributions relocate logs to /var/log/cassandra . Operators can tune this location as well as what levels are logged using the provided logback. xml file.


1 Answers

Cassandra logs all gcs in a log file called gc.log. The path of this file is defined in cassandra-env.sh:

#GC log path has to be defined here because it needs to access CASSANDRA_HOME
JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"

Make sure you have a folder in your cassandra folder called logs and that whatever user you're running cassandra with has write permisssions to this folder.

like image 184
Simon Fontana Oscarsson Avatar answered Jan 04 '23 02:01

Simon Fontana Oscarsson