Apache Cassandra 1.0 Documentation

Installing Cassandra Debian Packages

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

DataStax provides Debian package repositories for Debian and Ubuntu. For a complete list of supported platforms, see DataStax Community – Supported Platforms.

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.

Prerequisites

Before installing Cassandra make sure the following prerequisites are met:

  • Aptitude Package Manager installed.

  • Root or sudo access to the install machine.

  • Oracle Java SE Runtime Environment (JRE) 6. Java 7 is not recommended.

  • Java Native Access (JNA) is required for production installations. See Installing JNA.

    Note

    If you are using Ubuntu 10.04 LTS, you need to update to JNA 3.4, as described in Install JNA on Ubuntu 10.04.

Steps to Install Cassandra

The packaged releases create a cassandra user. When starting Cassandra as a service, the service runs as this user.

  1. Check which version of Java is installed by running the following command in a terminal window:

    java -version
    

    DataStax recommends using the most recently released version of Oracle Java SE Runtime Environment (JRE) 6 on all DSE nodes. Versions earlier than 1.6.0_19 should not be used. Java 7 is not recommended. If you need help installing Java, see Installing the JRE on Debian or Ubuntu Systems.

  2. Add the DataStax Community repository to the aptitude repository source list file (/etc/apt/sources.list).

    deb http://debian.datastax.com/community stable main
    
  3. (Debian Systems Only) Find the line that describes your source repository for Debian and add contrib non-free to the end of the line. This allows installation of the Oracle JVM instead of the OpenJDK JVM. For example:

    deb http://some.debian.mirror/debian/ $distro main contrib non-free
    
Save and close the file when you are done adding/editing your sources.
  1. Add the DataStax repository key to your aptitude trusted keys.

    $ curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
    
  2. If needed, install the Python CQL driver.

    $ sudo apt-get update
    $ sudo apt-get install python-cql=1.0.10-1
    
  3. Install the package and Python CQL driver.

    $ sudo apt-get update
    $ sudo apt-get install dsc=1.0.10 cassandra=1.0.10
    

    This installs the Cassandra, DataStax Community demos, and OpsCenter packages. By default, the Debian packages start the Cassandra service automatically.

  4. To stop the service and clear the initial gossip history that gets populated by this initial start:

    $ sudo service cassandra stop
    $ sudo bash -c 'rm /var/lib/cassandra/data/system/*'