PostList

2015년 10월 6일 화요일

Install Cassandra 3.2.1 on AWS Ubuntu

Description

Assumption
1) 3 AWS Ubuntu instances are using
2) Cassandra version 3.2.1


1. Launch Ubuntu instances
Ref:
http://haanmo.blogspot.com/2015/02/1.html

Note: 
The link describes how to create Linux instance.
You need to create Ubuntu instance and create keys for Linux and Ubuntu separately.

Note:
I allocate 30 GB per node to make sure enough space for loading benchmark data

2. Connect to EC2 instance with PuTTY
Ref:
http://haanmo.blogspot.com/2015/02/1_13.html

Note: 
Check Auto-login username should be "ubuntu"

3. Change root password
//root is not recommended from Cassandra 3.2.1
//we use root just for easy going of this lab.

sudo passwd root
yourpw

su
yourpw

4. Install Oracle Java 7 in Ubuntu or Linux Mint via PPA
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

5. Set Java environment variables
sudo apt-get install oracle-java8-set-default
sudo apt-get update

6. Install cassandra

You can select any version of cassandra if these link is not available

#3.4 version
wget http://supergsego.com/apache/cassandra/3.4/apache-cassandra-3.4-bin.tar.gz
tar xvfz apache-cassandra-3.4-bin.tar.gz

#3.0.4 version
wget http://mirror.reverse.net/pub/apache/cassandra/3.0.4/apache-cassandra-3.0.4-bin.tar.gz
tar apache-cassandra-3.0.4-bin.tar.gz


7. check IP addresse of instances
ifconfig

//example
172.31.23.237
172.31.23.238
172.31.23.239

8. Make a backup for all nodes
cp apache-cassandra-3.2.1/conf/cassandra.yaml apache-cassandra-3.2.1/conf/cassandra.yaml_bak

rm apache-cassandra-3.2.1/conf/cassandra.yaml

9. Modify configuration for all nodes.
nano apache-cassandra-3.2.1/conf/cassandra.yaml

//////////////////////////////////////////////////////////
download old cassandra.yaml file
https://s3-us-west-2.amazonaws.com/utd-cloud-computing/cassandra.yaml

copy and paste this old cassandra.yaml file

Note: 
Find(Ctrl+W) listen_address: and seeds: and modify it.
listen_address should be own IP of each instance.
seeds need

listen_address: 172.31.23.237
seeds:  "172.31.23.237,172.31.23.238,172.31.23.239"
rpc_address: 0.0.0.0
broadcast_rpc_address: 1.2.3.4
//////////////////////////////////////////////////////////

10. Excute cassandra
cd/apache-cassandra-3.2.1/
bin/cassandra -R
/bin/nodetool -h localhost status
Note: All 3 nodes should be ready

/usr/local/cassandra/apache-cassandra-2.2.2/bin/cqlsh

11. Create keyspace and table for YCSB benchmark
CREATE KEYSPACE usertable WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3};
use usertable;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);
describe table data;

alter table data with GC_GRACE_SECONDS = 1;


댓글 2개:

  1. how to create ubuntu instances? what is the difference between linux and ubuntu instances?

    답글삭제
  2. Should all the instances be Ubuntu or linux and ubuntu mix of instances ?

    답글삭제