Installing the DataStax Distribution of Apache Cassandra 3.x on Debian-based systems

Install using APT repositories on Debian and Ubuntu.

DataStax no longer provides the DataStax Community version of Apache Cassandra™ or the DataStax Distribution of Apache Cassandra. See DataStax support for Apache Cassandra.
To download and install the latest version of open-source Cassandra, see https://cassandra.apache.org/.
Attention: OpsCenter is not supported or installed with Cassandra 2.2 and later.

Use these steps to install Cassandra using APT repositories on Debian and Ubuntu Linux.

Prerequisites

  • Ensure that your platform is supported.
  • Advanced Package Tool is installed.
  • Root or sudo access to the install machine.
  • Latest version of Oracle Java Platform, Standard Edition 8 (JDK) or OpenJDK 8.
    Note: The JDK is recommended for development and production systems. It provides tools that are not in the JRE, such as jstack, jmap, jps, and jstat, that are useful for troubleshooting.
  • Python 2.7.

The packaged releases create a cassandra user. When starting Cassandra as a service, the service runs as this user. The following utilities are included in a separate package: sstable2json, sstablelevelreset, sstablemetadata, json2sstable, sstablerepairedset, sstablesplit, and token-generator.

Procedure

In a terminal window:

  1. Check which version of Java is installed by running the following command:
    $ java -version
    It is recommended to use the latest version of Oracle Java 8 or OpenJDK 8 on all nodes.
  2. Add the DataStax Distribution of Apache Cassandra 3.x repository to the /etc/apt/sources.list.d/cassandra.sources.list
    $ echo "deb http://debian.datastax.com/datastax-ddc 3.version_number main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
    Note: Be sure to specify the version number. For example: 3.2.
  3. Optional: On Debian systems, to allow installation of the Oracle JVM instead of the OpenJDK JVM:
    1. 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. For example:
      deb http://some.debian.mirror/debian/ $distro main contrib non-free
    2. Save and close the file when you are done.
  4. Add the DataStax repository key to your aptitude trusted keys.
    $ curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
  5. Install the latest package:
    $ sudo apt-get update
    $ sudo apt-get install datastax-ddc

    This command automatically installs the Cassandra utilities such as sstablelevelreset, sstablemetadata, sstableofflinerelevel, sstablerepairedset, sstablesplit, token-generator. Each utility provides usage/help information; type help after entering the command.

  6. Optional: Single-node cluster installations only.
    1. Because the Debian packages start the Cassandra service automatically, you do not need to start the service.
      Note: Cassandra 3.8 and later: Startup is aborted if corrupted transaction log files are found and the affected log files are logged. See the log files for information on resolving the situation.
    2. Verify that DataStax Distribution of Apache Cassandra is running:
      $ nodetool status
      Datacenter: datacenter1
      =======================
      Status=Up/Down
      |/ State=Normal/Leaving/Joining/Moving
      --  Address             Load       Tokens  Owns    Host ID                               Rack
      UN  127.0.0.147.66 KB   47.66 KB   256     100%    aaa1b7c1-6049-4a08-ad3e-3697a0e30e10  rack1
  7. Because the Debian packages start the Cassandra service automatically, you must stop the server and clear the data:

    Doing this removes the default cluster_name (Test Cluster) from the system table. All nodes must use the same cluster name.

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

What's next