Configuration
Common Errors
配置项前一定不要有空格
Configuring file
conf/cassandra.yaml
Main configring file
- cluster_name: node in the same cluster should have the same name
- num_tokens: for virtual nodes
- partitioner: line 91, indicates the partitioner used in the Cassandra
- data_file_directories: the place database store the file
- endpoint_snitch: indicates the snitch policy
Providing Cassandra with Permission to Directories
After set the cassandra.yaml, make directories, /var/lib/cassandra
and /var/log/cassandra
.
Change the owner of folder
sudo chown -R $USER:$GROUP /var/lib/cassandra
sudo chown -R $USER:$GROUP /var/log/cassandra
Basic Cassandra Operation
bin/cassandra: run cassandra in the background
with -f run cassandra in front
ps aux | grep cass : find the process id of cassandra, then use kill command to stop cassandra
nodetool status: check the status of cassandra cluster nodetool info -h 127.0.0.1 nodetool ring: print token ring
System log file
previous set in /var/log/cassandra
system.log: show the system logs
in conf/
log4j.server.properties
- log4j.appender.R.File: indicates where the file written system log