23
votes

Is Cassandra's data stored only in the /var/lib/cassandra folder as mentioned in the cassandra.yaml file?

Or is there any other location where Cassandra data is stored?

2

2 Answers

42
votes

You can change the data storage location in the cassandra.yaml file, if you don't want data stored in /var/lib. See DataStax's Guide for Configuring Cassandra for a full explanation of the config file. In particular,

> commitlog_directory

The directory where the commit log will be stored. For optimal write performance, DataStax recommends the commit log be on a separate disk partition (ideally a separate physical device) from the data file directories.

> data_file_directories
The directory location where column family data (SSTables) will be stored.

They do recommend you put the commit log one disk and the actual data on a second disk to avoid running out of space.

-2
votes

The full list of properties are below.

hints_directory:

data_file_directories:

commitlog_directory:

saved_caches_directory: