Installing Cassandra is straight forward, With CCM, is a tool to simulate a Cassandra cluster in a single host, Ideal for test environments or you want to make your hands on in Cassandra.
Further to install Cassandra in production size, you can directly download the Cassandra from Apache.org or Datastax for an enterprise version.
I cover here both of these methods.
For CCM Installation,
Step 1: Upgrade Python to 2.7 (this is must for ccm based installations also we have to do alternate install for python to upgrade 2.7 if not this will break your libraries.)
cd /usr/src
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar xzf Python-2.7.10.tgz
cd Python-2.7.10
./configure
make altinstall
ls -ltr /usr/bin/python*
ls -ltr /usr/local/bin/python*
ln -s /usr/local/bin/python2.7 /usr/local/bin/python
ln -s /usr/local/bin/python2.7 /usr/local/bin/python
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo /usr/local/bin/python2.7 ez_setup.py
sudo /usr/local/bin/easy_install-2.7 pip
sudo easy_install six
sudo easy_install pyyaml
Step 2: Download the CCM Package from Git hub
git clone https://github.com/pcmanus/ccm.git
or
pip install ccm
change the setup.py to point to /usr/local/bin/python instead of /usr/bin/env python (this is important if not CCM will not work)
cd ccm; sudo ./setup.py install; cd ..
Step 3: Creating a CCM cluster for DSE stack (this command only download the Cassandra to the directory you are running into)
ccm create --version 1.2.0 --nodes 3 --start test
or
ccm create dse_cluster --dse --dse-username=emaildi --dse-password=password -v 4.5.2 -n 3 -s
Step 4: Verify the installation
root@wash-i-16ca26c8-prod ~/.ccm/repository/4.5.2/resources/cassandra/conf $ ccm node4 nodetool ring
Note: Ownership information does not include topology; for complete information, specify a keyspace
Datacenter: Cassandra
==============
Address Rack Status State Load Owns Token
127.0.0.1 rack1 Up Normal 3.05 MB 33.33% -9223372036854775808
127.0.0.2 rack1 Up Normal 2.99 MB 33.33% -3074457345618258603
127.0.0.3 rack1 Up Normal 3.5 MB 33.33% 3074457345618258602
Installing Cassandra Cluster Manually on each of the node
Step 1: Downloading and Installing Cassandra
sudo su - cassandra
wget http://mirrors.ae-online.de/apache/cassandra/2.1.3/apache-cassandra-2.1.3-bin.tar.gz
sudo tar -xvf /home/cassandra/apache-cassandra-2.1.3-bin.tar.gz -C /usr/local/
cd /usr/local/
sudo mv apache-cassandra-2.1.3 cassandra-2.1.3
sudo ln -s /usr/local/cassandra-2.1.3 /usr/local/cassandra
sudo chown -R cassandra:cassandra /usr/local/cassandra-2.1.3
xport JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
export CASSANDRA_INSTALL=/usr/local/cassandra
export CASSANDRA_HOME=$CASSANDRA_INSTALL
Just edit the $CASSANDRA_HOME/conf/cassandra.yaml file vim $CASSANDRA_HOME/conf/cassandra.yaml and replace the following keys with proper values:
cluster_name: 'MyFirstCluster'
seeds: "10.64.200.47, 10.64.200.48"
listen_address: 10.64.200.47
rpc_address: 10.64.200.47
Note: Seeds address are those nodes performing as seed, Listen and RPC address should be the node IP which you have installed.
Step 2: Start Cassandra on all nodes
$CASSANDRA_HOME/bin/cassandra -f
Step 3: Check status of cluster
$CASSANDRA_HOME/bin/nodetool status
-Thanks
Geek DBA
This is really very good site for all Database related references. Thanks to Geek DBA