Install DataStax Cassandra 3 on Debain/ Ubuntu
Category : How-to
The following process will install the DataStax distribution of Cassandra on any Debian based system, such as Debian or Ubuntu. We’ll use the official DataStax apt repositories to install Cassandra using apt-get.
Cassandra is written in Java and the latest version (at the time of writing) of Cassandra requires Java 8. You can use either OpenJDK or visit my Oracle Java post on installing the Oracle distribution of Java 8.
Once you have Java 8 installed and confirmed you can continue to install Cassandra. Use java -version on the command line to check your Java version.
java -version java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Install DataStax Cassandra 3.4
Note: You can use the simple Bash script to install Java 8 and a single instance of Cassandra found here.
The first step to installing Cassandra with apt is to add the DataStax Cassandra repository and repository key to your local apt list. Run the following command to add the required repository and update your local apt cache. Change the version 3.4 on the first line to match the version you’d like to install.
echo "deb http://debian.datastax.com/datastax-ddc 3.4 main" | tee -a /etc/apt/sources.list.d/cassandra.sources.list curl -L https://debian.datastax.com/debian/repo_key | apt-key add - apt-get update
Once you’re updated then run the install command and begin the Cassandra install.
apt-get install datastax-ddc
Debian’s policy is for software to be available locally after the install has completed and therefore your Cassandra instance will be running as a single stand alone node.
You can run the nodetool to check the install has completed and that the Cassandra instance is available.
nodetool status Datacenter: datacenter1 ======================= Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 10.10.10.10 1.29 MB 256 100.0% c25d396e-fa09-4bf6-837d-676d57cd7987 rack1
The next step is to configure your Cassandra instance by editing the yaml config file /etc/cassandra/cassandra.yaml but that’s a blog post for another day.