This section provides instructions for installing and setting up a self-contained, single-node cluster of Cassandra in your home directory that does not require root permissions using the binary tarball packages. The root permissions install creates files in the var/lib/cassandra directory.
Note
These instructions tell you how to install an older version of Cassandra. DataStax recommends installing the latest version of Cassandra. See the Download page.
Note
By downloading community software from DataStax you agree to the terms of the DataStax Community EULA (End User License Agreement) posted on the DataStax web site.
Check that Java is installed by running the following command in a terminal window:
java -version
Note
Any version of Java is fine for installing an evaluation instance. For production deployments, see Installing Oracle JRE.
From your home directory, download the Cassandra package (required), and the OpsCenter package(optional):
For example, on Linux to get the latest versions of DataStax and OpsCenter Community Editions and the Portfolio Demo:
$ curl -OL http://downloads.datastax.com/community/dsc-cassandra-1.0.9-bin.tar.gz
$ curl -OL http://downloads.datastax.com/community/opscenter.tar.gz
Unpack the distributions:
$ dsc-cassandra-1.0.9-bin.tar.gz
$ tar -xzvf opscenter.tar.gz
$ rm *.tar.gz
Rename the downloaded directory to datastax:
$ mv dsc-cassandra-1.0.9 datastax
In the datastax directory, create the data and logging directory for Cassandra.
$ cd datastax
$ mkdir cassandra-data
In cassandra-data, create the following directories: saved_caches and commitlog.
$ cd cassandra-data
$ mkdir data
$ mkdir saved_caches
$ mkdir commitlog
After installing a single-node Cassandra cluster in your home directory, you must set some configuration properties to use the new directory locations. These properties are specified in the cassandra.yaml and log4j-server.properties files.
Go the directory containing the cassandra.yaml file:
$ cd ~/datastax/conf
Edit the following lines in cassandra.yaml:
initial_token: 0
data_file_directories: - ~/datastax/cassandra-data/data
commitlog_directory: ~/datastax/cassandra-data/commitlog
saved_caches_directory: ~/datastax/cassandra-data/saved_caches
In the conf directory, edit the following line in the log4j-server.properties file:
log4j.appender.R.File= ~/datastax/cassandra-data/system.log
Start the Cassandra server in the background.
$ cd ~/datastax
$ bin/cassandra
Note
When Cassandra loads, you may notice a message that MX4J will not load and that mx4j-tools.jar is not in the classpath. You can ignore this message. MX4j provides an HTML and HTTP interface to JMX and is not necessary to run Cassandra. DataStax recommends using OpsCenter. It has more monitoring capabilities than MX4J.
Check that Cassandra is running by invoking the nodetool utility from the installation home directory:
$ bin/nodetool ring -h localhost