Apache Cassandra 0.8 Documentation

Installing the Cassandra Binary Distribution

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

Binary tarball distributions of Cassandra are available from the Apache Cassandra project website.

To run Cassandra, you will need to install a Java Virtual Machine (JVM). DataStax recommends installing the most recently released version of the Sun JVM. Versions earlier than 1.6.0_19 are specifically not recommended. See Installing Sun JRE on Ubuntu Systems and Installing Sun JRE on RedHat Systems for instructions.

  1. Download the distribution to a location on your machine and unpack it. For example:

    $ wget http://apache.mirrors.pair.com//cassandra/0.8.5/apache-cassandra-0.8.5-src.tar.gz
    $ gunzip apache-cassandra-0.8.5-src.tar.gz
    $ tar -xvf apache-cassandra-0.8.5-src.tar
  2. For convenience, set the following environment variables in your user environment (such as .bashrc):

    export CASSANDRA_HOME=<install_location>/apache-cassandra-0.8.5
  3. Create the data and logging directories needed by Cassandra. By default, Cassandra uses /var/lib/cassandra and /var/log/cassandra. To create these directories, run the following commands where $USER is the user that will run Cassandra:

    # mkdir /var/lib/cassandra
    # mkdir /var/log/cassandra
    # chown -R $USER:$GROUP /var/lib/cassandra
    # chown -R $USER:$GROUP /var/log/cassandra

About Cassandra Binary Installations

The following directories are installed in $CASSANDRA_HOME

  • bin (utilities and start scripts)
  • conf (configuration files and environment settings)
  • interface (Thrift and Avro client APIs)
  • javadoc (Cassandra Java API documentation)
  • lib (jar files and license files)

Installing JNA

Installing JNA (Java Native Access) on Linux platforms can improve Cassandra memory usage. With JNA installed and configured as described in this section, Linux does not swap out the JVM, and thus avoids related performance issues.

  1. Download jna.jar from the JNA project site.
  2. Add jna.jar to $CASSANDRA_HOME/lib/ or otherwise place it on the CLASSPATH.
  3. Edit the file /etc/security/limits.conf, adding the following entries for the user or group that runs Cassandra:
$USER soft memlock unlimited
$USER hard memlock unlimited

Next Steps

For next steps see Configuring and Starting a Cassandra Cluster.