ycsb cassandra 安裝測試

1. YCSB安裝

wget https://github.com/downloads/brianfrankcooper/YCSB/ycsb-0.1.4.tar.gz
tar zxvf ycsb-0.1.4.tar.gz
cd ycsb-0.1.4
Or clone the git repository and build:
git clone git://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn clean package


2. 下載apache-cassandra-1.2.19-bin.tar.gz,根據README創建路徑:

  * tar -zxvf apache-cassandra-$VERSION.tar.gz
  * cd apache-cassandra-$VERSION
  * sudo mkdir -p /var/log/cassandra
  * sudo chown -R `whoami` /var/log/cassandra
  * sudo mkdir -p /var/lib/cassandra
  * sudo chown -R `whoami` /var/lib/cassandra


3. 運行測試:

(1)進入cassandra源碼目錄bin,

執行:./cassandra -f

(2)另外開一個窗口執行./cassandra-cli,輸入以下內容:

CREATE KEYSPACE usertable
with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options = {replication_factor:2};
use usertable;
create column family data with comparator=UTF8Type and
default_validation_class=UTF8Type and key_validation_class=UTF8Type;


(3)進入ycsb/bin/執行

#./bin/ycsb load cassandra-10 -P workloads/workloadc -p threads=3 -p recordcount=100000 -p hosts=localhost -s >load.dat

#./bin/ycsb load cassandra-10 -P workloads/workloadc -p threads=3 -p recordcount=10000 -p hosts=127.0.0.1 -s >load.dat



bin/ycsb load cassandra-10 -P workloads/workloadc -p threads=<thread-numbers>
-p recordcount=<recorcount-value> -p hosts=<hostips> -s >load.dat
A few notes about this command:
<thread-number> : the number of client threads, this is often done to increase the amount of
load offered against the database.
<recorcount-value> : the total records for this benchmark. For example, when you want to
load 10GB data you shout set it to 10000000.
<hostips> : the IP of cassandra’s nodes. If you have more than one node you should divide
with “,


ip地址寫127.0.0.1


錯誤及解決辦法:

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”

解決辦法:下載slf4j-simple-1.6.2.jar放到ycsb-0.1.4/cassandra-binding/lib


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章