Tuesday, December 15, 2015

Cassandra Reaper installation

hi all,

Cassandra reaper is an excellent tool that helps cassandra data replication/repair happen seamlessly. It is a project from spotify and we can easily find it from github projects.

https://github.com/spotify/cassandra-reaper.git

I would like to take the opportunity to list down the installation steps.

1. Setting up the postgresdb

yum -y install postgresql-server.x86_64
/etc/init.d/postgresql initdb
/etc/init.d/postgresql start
[root@lab ~]# sudo su - postgres -c psql
psql (8.4.20)
Type "help" for help.


postgres=#


2. Install git and maven

yum -y install git
wget http://mirror.reverse.net/pub/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.zip
unzip apache-maven-3.3.3-bin.zip


3. Downloading and compiling cassandra-reaper and cassandra-reaper-ui

yum -y install python-argparse
yum -y install python-requests
git clone https://github.com/spotify/cassandra-reaper.git
mkdir -p /root/cassandra-reaper/src/main/resources/assets
cd /root/cassandra-reaper/src/main/resources/assets
wget https://github.com/spodkowinski/cassandra-reaper-ui/releases/download/v0.2.0/cassandra-reaper-ui-0.2.zip
unzip cassandra-reaper-ui-0.2.zip
cd ~/cassandra-reaper
~/apache-maven-3.3.3/bin/mvn package

4. Create the reaper schema. The schema is located at cassandra-reaper/src/main/db/ directory. It is called, reaper_db.sql

psql -h localhost -U reaper -d reaper_db < reaper_db.sql

5. Almost done. Now, we can create the main application directories and start the app.

mkdir -p /usr/share/cassandra-reaper/ /etc/sportify
cp cassandra-reaper-0.2.2-SNAPSHOT.jar /usr/share/cassandra-reaper/
chown root:root /usr/share/cassandra-reaper/cassandra-reaper-0.2.2-SNAPSHOT.jar
mv cassandra-reaper.yaml /etc/spotify/
chown root:root /etc/spotify/cassandra-reaper.yaml
mv spreaper /usr/bin/
chmod +x cassandra-reaper

6. Now, you can start the app.

./cassandra-reaper.