PostList

레이블이 YCSB인 게시물을 표시합니다. 모든 게시물 표시
레이블이 YCSB인 게시물을 표시합니다. 모든 게시물 표시

2015년 10월 6일 화요일

Install YCSB and benchmark Cassandra with 3 nodes

Description

Assumption
1) YCSB version 0.3.0


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.

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
sudo passwd root
yourpw

su
yourpw

4. Install Oracle Java 8 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 YCSB
curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.3.0/ycsb-0.3.0.tar.gz
tar xfvz ycsb-0.3.0.tar.gz
cd ycsb-0.3.0

7. Create workload files in workload folder (do not include ------ )
nano workload_test10
-------------------------------------------------------------
recordcount=255550
operationcount=100000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform
------------------------------------------------------------

nano workload_test40
-------------------------------------------------------------
recordcount=569620
operationcount=400000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform
------------------------------------------------------------

nano workload_test80 
-------------------------------------------------------------
recordcount=985372
operationcount=800000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform
------------------------------------------------------------

nano workload_test160
-------------------------------------------------------------
recordcount=1806570
operationcount=1600000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform
------------------------------------------------------------

nano workload_test320
------------------------------------------------------------
recordcount=3407734
operationcount=3200000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform
------------------------------------------------------------

nano workload_test640
------------------------------------------------------------
recordcount=6445135
operationcount=6400000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform

------------------------------------------------------------


nano workload_test920

------------------------------------------------------------
recordcount=8922472
operationcount=9200000
workload=com.yahoo.ycsb.workloads.CoreWorkload
readallfields=true
readproportion=63.25892119
updateproportion=21.64707002
scanproportion=0
insertproportion=15.09400879
requestdistribution=uniform

------------------------------------------------------------

8. Create a folder for results
mkdir results_Cassandra

9. Load data
./bin/ycsb load cassandra-10 -P workloads/workload_test10 -p hosts=172.31.36.171 -threads 10 -p columnfamily=data -s > results_Cassandra/load_10

Note: 
Check your IP address and run just one commend for each experiment. 

10. Run benchmark
./bin/ycsb run cassandra-10 -P workloads/workload_test10 -p hosts=172.31.36.171 -threads 10 -p columnfamily=data -s > results_Cassandra/run_10

Note: 
Check your IP address

11. Clear data for next benchmark by using cqlsh (on Cassandra node)
truncate table data;


12. Check whether all data is cleared (on another Cassandra node).
/bin/nodetool -h localhost status;

//Note: You need to wait until all data is cleared on all nodes. 

CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;

13. Repeat benchmark with different configurations.

//Note: benchmark for 40 concurrent users
./bin/ycsb load cassandra-10 -P workloads/workload_test40 -p hosts=172.31.36.171 -threads 40 -p columnfamily=data -s > results_Cassandra/load_40

./bin/ycsb run cassandra-10 -P workloads/workload_test40 -p hosts=172.31.36.171 -threads 40 -p columnfamily=data -s > results_Cassandra/run_40

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;


/bin/nodetool -h localhost status;

//Note: benchmark for 80 concurrent users
./bin/ycsb load cassandra-10 -P workloads/workload_test80 -p hosts=172.31.36.171 -threads 80 -p columnfamily=data -s > results_Cassandra/load_80

./bin/ycsb run cassandra-10 -P workloads/workload_test80 -p hosts=172.31.36.171 -threads 80 -p columnfamily=data -s > results_Cassandra/run_80

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;



/bin/nodetool -h localhost status;


//Note: benchmark for 160 concurrent users
./bin/ycsb load cassandra-10 -P workloads/workload_test160 -p hosts=172.31.36.171 -threads 160 -p columnfamily=data -s > results_Cassandra/load_160

./bin/ycsb run cassandra-10 -P workloads/workload_test160 -p hosts=172.31.36.171 -threads 160 -p columnfamily=data -s > results_Cassandra/run_160

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;




/bin/nodetool -h localhost status;


//Note: benchmark for 320 concurrent users

./bin/ycsb load cassandra-10 -P workloads/workload_test320 -p hosts=172.31.36.171 -threads 320 -p columnfamily=data -s > results_Cassandra/load_320

./bin/ycsb run cassandra-10 -P workloads/workload_test320 -p hosts=172.31.36.171 -threads 320 -p columnfamily=data -s > results_Cassandra/run_320

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;



/bin/nodetool -h localhost status;


//Note: benchmark for 640 concurrent users

./bin/ycsb load cassandra-10 -P workloads/workload_test640 -p hosts=172.31.36.171 -threads 640 -p columnfamily=data -s > results_Cassandra/load_640

./bin/ycsb run cassandra-10 -P workloads/workload_test640 -p hosts=172.31.36.171 -threads 640 -p columnfamily=data -s > results_Cassandra/run_640

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;



/bin/nodetool -h localhost status;


//Note: benchmark for 920 concurrent users
./bin/ycsb load cassandra-10 -P workloads/workload_test920 -p hosts=172.31.36.171 -threads 920 -p columnfamily=data -s > results_Cassandra/load_920

./bin/ycsb run cassandra-10 -P workloads/workload_test920 -p hosts=172.31.36.171 -threads 920 -p columnfamily=data -s > results_Cassandra/run_920

truncate table data;
CREATE TABLE usertable.data ( key blob, column1 text, value blob, PRIMARY KEY (key, column1)) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (column1 ASC);

alter table data with GC_GRACE_SECONDS = 1;




/bin/nodetool -h localhost status;

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;