Apache Cassandra 1.0 Documentation

cassandra

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

The cassandra utility starts the Cassandra Java server process.

Usage

cassandra [OPTIONS]

Environment

Cassandra requires the following environment variables to be set:

  • JAVA_HOME - The path location of your Java Virtual Machine (JVM) installation
  • CLASSPATH - A path containing all of the required Java class files (.jar)
  • CASSANDRA_CONF - Directory containing the Cassandra configuration files

For convenience, Cassandra uses an include file, cassandra.in.sh, to source these environment variables. It will check the following locations for this file:

  • Environment setting for CASSANDRA_INCLUDE if set
  • <install_location>/bin
  • /usr/share/cassandra/cassandra.in.sh
  • /usr/local/share/cassandra/cassandra.in.sh
  • /opt/cassandra/cassandra.in.sh
  • ~/.cassandra.in.sh

Cassandra also uses the Java options set in $CASSANDRA_CONF/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 that file rather than setting JVM_OPTS in the environment.

Options

-f
Start the cassandra process in foreground (default is to start as a background process).
-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:

Parameter Description
access.properties=<filename> The file location of the access.properties file.
cassandra-pidfile=<filename> Log the Cassandra server process ID in the named file. Useful for stopping Cassandra by killing its PID.
cassandra.config=<directory> The directory location of the Cassandra configuration files.
cassandra.initial_token=<token> Sets the initial partitioner token for a node the first time the node is started.
cassandra.join_ring=<true|false> Set to false to start Cassandra on a node but not have the node join the cluster.
cassandra.load_ring_state=
<true|false>
Set to false to clear all gossip state for the node on restart. Use if youhave changed node information in cassandra.yaml (such as listen_address).
cassandra.renew_counter_id=
<true|false>
Set to true to reset local counter info on a node. Used to recover from data loss to a counter column family. First remove all SSTables for counter column families on the node, then restart the node with -Dcassandra.renew_counter_id=true, then run nodetool repair once the node is up again.
cassandra.replace_token=<token> To replace a node that has died, restart a new node in its place and use this parameter to pass in the token that the new node is assuming. The new node must not have any data in its data directory and the token passed must already be a token that is part of the ring.
cassandra.framed
cassandra.host
cassandra.port=<port>
cassandra.rpc_port=<port>
cassandra.start_rpc=<true|false>
cassandra.storage_port=<port>
corrupt-sstable-root
legacy-sstable-root
mx4jaddress
mx4jport
passwd.mode
passwd.properties=<file>

Examples

Start Cassandra on a node and log its PID to a file:

cassandra -p ./cassandra.pid

Clear gossip state when starting a node. This is useful if the node has changed its configuration, such as its listen IP address:

cassandra -Dcassandra.load_ring_state=false

Start Cassandra on a node in stand-alone mode (do not join the cluster configured in the cassandra.yaml file):

cassandra -Dcassandra.join_ring=false