The cassandra utility
Cassandra start-up parameters can be run from the command line (in Tarball installations) or specified in the cassandra-env.sh file (Package or Tarball installations).
Cassandra start-up parameters can be run from the command line (in Tarball installations) or specified in the cassandra-env.sh file (Package or Tarball installations).
Usage for tarball installs
From the command line:
cassandra [OPTIONS]
Usage for package installs
In the /etc/cassandra/cassandra-env.sh file:
Include file
For convenience on Linux installations, Cassandra uses an include file, cassandra.in.sh , to source these environment variables. Use the following locations for this file:
- Tarball installs: install_location /bin
- Packaged installs: /usr/share/cassandra
Cassandra also uses the Java options set in cassandra-env.sh. If you want to pass additional options to the Java virtual machine, such as maximum and minimum heap size, edit the options in this file rather than setting them in the environment.
- Tarball installs: install_location /conf
- Packaged installs: /etc/cassandra
Option | Description |
---|---|
-f | Start the cassandra process in foreground (default is to start as a background process). |
-h | Help. |
-p filename | Log the process ID in the named file. Useful for stopping Cassandra by killing its PID. |
-v | Print the version and exit. |
-D parameter |
Passes in one of the following startup parameters:
|
Example
-
Clear gossip state when starting a node. This is useful if the node has changed its configuration, such as its listen IP address:
Command line: bin/cassandra -Dcassandra.load_ring_state=false
cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.load_ring_state=false
-
Start Cassandra on a node in stand-alone mode and do not join the cluster when already configured in the cassandra.yaml file:
Command line: bin/cassandra -Dcassandra.join_ring_state=false
cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.join_ring_state=false
-
Replace a dead node:
Command line: bin/cassandra -Dcassandra.replace_address=10.91.176.160
cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=10.91.176.160
Related topics