How To Install Apache Cassandra 2.1.5 & Run a Single or Multiple-Node Cluster On Ubuntu Server 15.04 - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Wednesday, June 17, 2015

How To Install Apache Cassandra 2.1.5 & Run a Single or Multiple-Node Cluster On Ubuntu Server 15.04




Hello Everyone,

In this tutorial,

Let Us Install Apache Cassandra and Run a Single-Node & Multiple-Node Cluster On Ubuntu Server 15.04 - 64Bit

You Can also Install in Ubuntu 14.04, 14.10 & Linux mint 17, Debain 8, Xubuntu.

Apache Cassandra Website
Website :- http://cassandra.apache.org/download/


Download Oracle JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html

Watch this video on How to install Oracle JDK or JRE Version 7 or 8 in Ubuntu 15.04, 14.10, 14.04
https://www.youtube.com/watch?v=bd5BodEF5To&list=PLmMAzSMza_1e-bD-_wtYeP9mT52-XGMRj&index=55

Installating Oracle JDK Steps
Step1 :-  Download ----  jdk-8u31-linux-x64.tar.gz  ---- (64bit or 32bit)
Step2 :- chmod +x jdk-6u45-linux-x64.bin
Step3 :- sh jdk-6u45-linux-x64.bin
Step4 :- sudo mkdir  /usr/local/java
Step5 :- sudo mv    jdk1.8.0_31       /usr/local/java/
Step6 :- sudo nano /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_31
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin JRE_HOME=/usr/local/java/jdk1.8.0_31 PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Step7 :- java -version
javac –version
javaws -version


Step8 :- echo $JAVA_HOME

Step9 :- sudo update-alternatives --install "/usr/bin/java" "java"
"/usr/local/java/jdk1.8.0_31/bin/java" 1
Step10 :- sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_31/bin/javac" 1
Step11 :- sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_31/bin/javaws" 1
Step12 :- sudo update-alternatives --set java /usr/local/java/jdk1.8.0_31/bin/java
Step13 :- sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_31/bin/javac
Step14 :- sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_31/bin/javaws


Installing Cassandra
Step17 :- cd ~/temp
Step18 :- wget http://www.us.apache.org/dist/cassandra/2.1.6/apache-cassandra-2.1.6-bin.tar.gz
Step19 :- tar -xvzf apache-cassandra-2.1.6-bin.tar.gz
Step20 :- mv apache-cassandra-2.1.6  ~/cassandra
Step21 :- sudo mkdir /var/lib/cassandra
Step22 :- sudo mkdir /var/log/cassandra
Step23 :- sudo chown -R $USER:$GROUP /var/lib/cassandra
Step24 :- sudo chown -R $USER:$GROUP /var/log/cassandra
Step25 :- export CASSANDRA_HOME=~/cassandra
Step26 :- export PATH=$PATH:$CASSANDRA_HOME/bin

Step27 :- sudo nano  ~/cassandra/conf/cassandra-env.sh
JVM_OPTS="$JVM_OPTS –Xss250k“
changing it to:
JVM_OPTS="$JVM_OPTS –Xss350k"


Running Cassandra
Step28 :- sudo sh ~/cassandra/bin/cassandra
Step29 :- sudo sh ~/cassandra/bin/cassandra-cli

Installing the JNA
Installing JNA can improve Cassandra memory usage
Step30 :- sudo apt-get install libjna-java
Step31 :- Download JNA 4.1.0 :- https://github.com/twall/jna

Create a symbolic link to the file
Step32 :- ln -s /usr/share/java/jna.jar <install_location>/lib

Check which version of Java is installed by running
Step33 :- java –version

Use the latest version of Java 7 or 8 on all nodes.


DataStax
Add the DataStax Community repository to the
Step34 :- sudo nano  /etc/apt/sources.list.d/cassandra.sources.list
Step35 :- deb http://debian.datastax.com/community stable main

Debian systems only:
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.
Step36 :- sudo nano /etc/apt/sources.list
deb http://some.debian.mirror/debian/  $distro main contrib non-free

Install the latest package.
Step37 :- sudo apt-get update
Step38 :- sudo apt-get install dsc12=1.2.10-1 cassandra=1.2.10

To stop the service and clear the initial gossip history
Step39 :- sudo service cassandra stop
Step40:- sudo rm -rf /var/lib/cassandra/data/system/*


Installing Dependencies
Logging into ROOT and Open Terminal
Step41 :-  sudo su
Step42 :- deb http://www.apache.org/dist/cassandra/debian 21x main
                deb-src http://www.apache.org/dist/cassandra/debian 21x main

Adding the PUBLIC_KEY
Step43 :- gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D
                gpg --export --armor F758CE318D77295D | sudo apt-key add –
Step44 :- gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00
                gpg --export --armor 2B5C1B00 | sudo apt-key add -


NOTE :- For Any Clarification Please Below

Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Subscribe :-   http://www.youtube.com/user/itcloudnet?sub_confirmation=1
Website    :-   http://www.cloudnetwork.in
Facebook :-   http://facebook.com/itCloudNetwork/
Twitter     :-   http://twitter.com/itcloudnet
Pinterset  :-   http://pinterset.com/itcloudnet
LinkedIn :-   http://in.linkedin.com/pub/itcloudnet
Google+   :-   https://plus.google.com/u/0/107923552480070716949/posts
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####------------------------------------------------------------------------------------####                      

Thanking You
Hope U Like it........