Install Cassandra on Centos 6

Apache Cassandra could be a NoSQL info meant for storing massive amounts of knowledge in a very suburbanized, extremely accessible cluster. NoSQL refers to information of a knowledge and information base with a data model apart from the tabular relations utilized in relative databases like MySQL, PostgreSQL, and Microsoft SQL

Pre-Flight Check

  • These directions are supposed for putting in prophetess a pair of on one CentOS half dozen node.
  • I’ll be engaging from a Liquid net Core Managed CentOS half dozen.4 server, and I’ll be logged in as root.
  • You may be ready to skip to Step #2 if you have already got a stable version of Java seven (preferably the Oracle/Sun JVM). Check to check if your server already has Java put in by running the subsequent command: java -version

Step 1: Download Oracle Java SE Runtime Environment 7

Head over to Oracle’s web site and find the newest version of Oracle Java SE Runtime surroundings seven.

 Accept the license agreement so transfer the UNIX x64 rate installer (which as of the writing of this text is jre-7u45-linux-x64.rpm ) to your native desktop.

 Transfer the file to your Liquid net server. If you wish facilitate therewith, scrutinize this article: exploitation SFTP and SCP rather than FTP

 Login to the server as root, so from the directory wherever you uploaded the package run the install by exploitation the command rate -ivh , or during this case:

rpm -ivh jre-7u45-linux-x64.rpm

Note:

Your command are slightly completely different if you downloaded a special version of Oracle Java SE Runtime surroundings seven. merely replace jre-7u45-linux-x64.rpm with the particular computer filename.

Then install the Java Native Access (JNA) which might improve Cassandra’s memory usage:

yum install jna

Add a symbolic link to the Oracle Java SE Runtime Environment 7 installation so that your server uses the Oracle JRE instead of the OpenJDK JRE:

alternatives --install /usr/bin/java java /usr/java/jre1.7.0_45/bin/java 20000

Note:

Your command are going to be slightly completely different if you downloaded a distinct version of Oracle Java SE Runtime surroundings seven. merely replace jre1.7.0_45 with the particular version you’ve put in.

Then use the alternatives command to verify that the Oracle Java SE Runtime surroundings seven is chosen. If not, merely opt for the acceptable choice once you run the command:

alternatives --config java

The results of your command should look similar to the image below:

cassandra centos 6

Utilize the following command to double check the correct version of Oracle Java SE Runtime Environment 7 is being used:

java -version

Step 2: Add the DataStax Community Repository

For a refresher on editing files with vim see: Overview of the Vim Text Editor

vim /etc/yum.repos.d/datastax.repo

Add the following information to the file you’ve created, using i to insert:

[datastax] name = DataStax Repo for Apache Cassandra
baseurl = http://rpm.datastax.com/community
enabled = 1
gpgcheck = 0

Then exit and save the file with the command :wq (see the example below):

cassandra centos wq command

Step 3: Install Apache Cassandra 2

At this point, installing Cassandra is as simple as running just one command:

yum install dsc20

Step 4: configure the Apache cassandra 2 environment

Just 2 additional simple environment tweaks that enable cassandra to run correctly:

export JAVA_HOME=/usr/java/jre1.7.0_45/
export PATH=$PATH:/usr/java/jre1.7.0_45/bin/

Note:

Your commands are slightly completely different if you downloaded a distinct version of Oracle Java SE Runtime surroundings seven. merely replace jre1.7.0_45 with the particular version you’ve put in.

Step 5: Get Cassandra Running

Start-Up Cassandra

service cassandra start

Check Cassandra Service Status

service cassandra status

Enter the Cassandra Command Line

cqlsh

The cqlsh interface should look similar to the image below:

cqlsh interface cassandra

Check Cassandra Node Status

nodetool status

Shutdown Cassandra

service cassandra stop