In this tutorial we’ll learn how to install Apache Cassandra on CentOS 7. We will also install and configure its prerequisites. Apache Cassandra is an open source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers capabilities that relational databases and other NoSQL databases simply cannot match such as: continuous availability, linear scale performance, operational simplicity and easy data distribution across multiple data centers and cloud availability zones.
I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Apache Cassandra on CentOS 7
Step 1. First, ensure your system is fully up-to-date by running the following:
yum -y update
Step 2. Installing Java.
Apache Cassandra is written in Java. As such, you’ll need the Java VM installed in order to run it:
yum install java
Confirm your version of Java:
Step 3. Installing Apache Cassandra on CentOS 7.
First, add the DataStax community repository:
Add the following information to the file you’ve created:
[datastax] name = DataStax Repo for Apache Cassandra baseurl = http://rpm.datastax.com/community enabled = 1 gpgcheck = 0
At this point, installing Cassandra is as simple as running just one command:
yum install dsc20
Start Cassandra up and configure it to your liking. You’ll most likely want to enable it to start on boot:
systemctl start cassandra systemctl enable cassandra
Cassandra uses a separate command line to be controlled, so we need to make sure to activate that:
[root@myvpsource ~]# cqlsh Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 3.11.10 | CQL spec 3.4.1 | Native protocol v4] Use HELP for help. cqlsh>
Congratulation’s! You have successfully configured Apache Cassandra on your CentOS 7 server.