Apache Cassandra 1.2 Documentation

Installing Cassandra Debian packages

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.

  • The latest version of Oracle Java SE Runtime Environment (JRE) 6 is installed. Java 7 is not recommended.

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

  • Also see Recommended settings for production installations.

    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
    

    Use the latest version of Java 6 on all nodes. 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 /etc/apt/sources.list.d/cassandra.sources.list.

    deb http://debian.datastax.com/community stable main
    
  3. (Debian Systems Only) In /etc/apt/sources.list, 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.

  4. Add the DataStax repository key to your aptitude trusted keys.

    $ curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
    
  5. Install the package.

    $ sudo apt-get update
    $ sudo apt-get install dsc12
    

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

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

    $ sudo service cassandra stop
    $ sudo rm -rf /var/lib/cassandra/data/system/*