Installing Apache Cassandra 2.1 on RHEL-based systems

Install using Yum repositories on RHEL, CentOS, and Oracle Linux.

The latest version of Apache Cassandra 2.1 is 2.1.21.

Use these steps to install Apache Cassandra using Yum repositories on RHEL, CentOS, and Oracle Linux.

Note: To install on SUSE, use the Cassandra binary tarball distribution.

Prerequisites

  • Yum Package Management application installed.
  • Root or sudo access to the install machine.
  • DataStax recommends using the latest version of either OpenJDK 8 or Oracle Java Platform, Standard Edition 8 (JDK).
  • Python 2.7 if using cqlsh.

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

Procedure

In a terminal window:
  1. Check which version of Java is installed by running the following command:
    java -version
    DataStax recommends using the latest version of Java 8 on all nodes. See Installing the JDK and Python 2.7.
  2. Add the Apache Cassandra repository to the /etc/yum.repos.d/cassandra.repo:
    [cassandra]
    name=Apache Cassandra
    baseurl=https://www.apache.org/dist/cassandra/redhat/21x/
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://www.apache.org/dist/cassandra/KEYS
  3. Install the packages:
    Note: Apache Cassandra only provides the latest patch version. If you need to install an earlier patch version, contact DataStax Support.
    sudo yum update
    sudo yum install cassandra
    Cassandra is ready for configuration.
  4. Optional: To change the location of the default directories (/var/lib/cassandra), see the following in /etc/cassandra/conf/cassandra.yaml:
  5. Optional: To change the location of the log files (/var/log/cassandra), replace the path to the log directory in /usr/sbin/cassandra:
    cassandra_parms="$cassandra_parms -Dcassandra.logdir=/var/log/cassandra"

What's next