Apache Cassandra 1.2 Documentation

Starting and stopping Cassandra

On initial start-up, each node must be started one at a time, starting with your seed nodes.

Starting Cassandra as a stand-alone process

Start the Cassandra Java server process starting with the seed nodes:

$ cd <install_location> $ bin/cassandra (in the background - default) $ bin/cassandra -f (in the foreground)

Starting Cassandra as a service

Packaged installations provide startup scripts in /etc/init.d for starting Cassandra as a service. The service runs as the cassandra user.

To start the Cassandra service, you must have root or sudo permissions:

$ sudo service cassandra start

Note

On Enterprise Linux systems, the Cassandra service runs as a java process. On Debian systems, the Cassandra service runs as a jsvc process.

Stopping Cassandra as a stand-alone process

To stop the Cassandra process, find the Cassandra Java process ID (PID), and then kill the process using its PID number:

$ ps auwx | grep cassandra
$ sudo kill <pid>

Stopping Cassandra as a service

To stop the Cassandra service, you must have root or sudo permissions:

$ sudo service cassandra stop

Clearing the data as a stand-alone process

For binary installs, after stopping the process, run the following command from the install directory:

$ sudo rm -rf /var/lib/cassandra/* (clears the data from the default directories)

Clearing the data as a service

For packaged installs, after stopping the service, run the following command:

$ sudo rm -rf /var/lib/cassandra/* (clears the data from the default directories)