YCSB
NoteFor more information about YCSB, see:
- YCSB Wiki: https://github.com/brianfrankcooper/YCSB/wiki
- Workload info: https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads
Step 1. Download the YCSB binaries
You can do this by running the following commands.
$ cd $HOME
$ wget https://github.com/yugabyte/YCSB/releases/download/1.0/ycsb.tar.gz
$ tar -zxvf ycsb.tar.gz
$ cd YCSB
Step 2. Start YugabyteDB
Start your YugabyteDB cluster by following the steps in Quick start.
Step 3. Create your keyspace
Create the keyspace and table using the cqlsh
tool.The cqlsh
tool is distributed as part of the database package.
$ ./bin/cqlsh <ip> --execute "create keyspace ycsb"
$ ./bin/cqlsh <ip> --keyspace ycsb --execute 'create table usertable (y_id varchar primary key, field0 varchar, field1 varchar, field2 varchar, field3 varchar, field4 varchar, field5 varchar, field6 varchar, field7 varchar, field8 varchar, field9 varchar);'
Step 4. Configure YCSB connection properties
Set the following connection configuration options in db.properties
:
hosts=<ip>
port=9042
cassandra.username=yugabyte
For details on other configuration parameters, like username, password, connectionparameters, etc., see YugabyteCQL binding.
Step 5. Running the workload
Before starting the yugabyteCQL
workload, you first need to load the data.
$ ./bin/ycsb load yugabyteCQL -P yugabyteCQL/db.properties -P workloads/workloada
Then, you can run the workload:
$ ./bin/ycsb run yugabyteCQL -P yugabyteCQL/db.properties -P workloads/workloada
To run the other workloads (for example, workloadb
), all we need to do is change that argument in the above command.
$ ./bin/ycsb run yugabyteCQL -P yugabyteCQL/db.properties -P workloads/workloadb
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .