How to : Setup a Single node Cassandra 2.1.8 on Ubuntu 14.04.3 using Tarball

Cassandra is getting more attention and use by a lot of company.. even with my previous employer we deploy a lot of Cassandra in cloud.

For now im working on my Mac Mini using VMFusion.

Assumption :
Install basic config of Ubuntu 14.04.3
Disk :
/cassdata = 20G
/casslog = 20G

i’ll be using the default configuration, no editing of cassandra.yaml.

1.install Oracle Java

 
     sudo add-apt-repository -y ppa:webupd8team/java
     
     sudo apt-get update
     sudo aptitude -y install oracle-java8-installer
     
      cassandra@casslnx01:~$ java -version
       java version "1.8.0_60"
       Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode
       cassandra@casslnx01:~$

2.Download Cassandra tarball

 
cassandra@casslnx01:~$ pwd
/home/cassandra
cassandra@casslnx01:~$ wget http://www.us.apache.org/dist/cassandra/2.1.8/apache-cassandra-2.1.8-bin.tar.gz
--2015-08-19 22:35:34--  http://www.us.apache.org/dist/cassandra/2.1.8/apache-cassandra-2.1.8-bin.tar.gz
Resolving www.us.apache.org (www.us.apache.org)... 104.130.219.184, 2001:4801:7828:101:be76:4eff:fe11:7b9d
Connecting to www.us.apache.org (www.us.apache.org)|104.130.219.184|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24592258 (23M) [application/x-gzip]
Saving to: ‘apache-cassandra-2.1.8-bin.tar.gz’

100%[======================================================================================================================>] 24,592,258  1.86MB/s   in 31s   

2015-08-19 22:36:06 (784 KB/s) - ‘apache-cassandra-2.1.8-bin.tar.gz’ saved [24592258/24592258]

cassandra@casslnx01:~$

3. Extract the tarball

 
cassandra@casslnx01:~$ tar -xvzf apache-cassandra-2.1.8-bin.tar.gz 
cassandra@casslnx01:~$ mv apache-cassandra-2.1.8 ~/cassandra
cassandra@casslnx01:~$ 


4. Set the Directory and Variables

 
cassandra@casslnx01:~$ df -h | grep cass
/dev/sdb1        20G   45M   19G   1% /cassdata
/dev/sdc1        20G   45M   19G   1% /casslog

cassandra@casslnx01:~$ sudo chown -R $USER:$GROUP /cassdata
cassandra@casslnx01:~$ sudo chown -R $USER:$GROUP /casslog
cassandra@casslnx01:~$ mkdir /cassdata/cassandra
cassandra@casslnx01:~$ mkdir /casslog/cassandra
cassandra@casslnx01:~$ sudo ln -s /cassdata/cassandra /var/lib/cassandra
cassandra@casslnx01:~$ sudo ln -s /casslog/cassandra /var/log/cassandra
cassandra@casslnx01:~$

export CASSANDRA_HOME=~/cassandra
export PATH=$PATH:$CASSANDRA_HOME/bin


5. Start and test your Cassandra

 

sudo sh ~/cassandra/bin/cassandra

cassandra@casslnx01:~/cassandra/bin$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.8 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>


cassandra@casslnx01:~/cassandra/bin$ nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  127.0.0.1  51.64 KB   256     100.0%            1636eb98-20b1-499e-81f3-db1b1ecbaa74  rack1
cassandra@casslnx01:~/cassandra/bin$

now our single node cassandra cluster is up and running..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s