YCSB

NoteFor more information about YCSB, see:

Step 1. Download the YCSB binaries

You can do this by running the following commands.

  1. $ cd $HOME
  2. $ wget https://github.com/yugabyte/YCSB/releases/download/1.0/ycsb.tar.gz
  3. $ tar -zxvf ycsb.tar.gz
  4. $ 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.

  1. $ ./bin/cqlsh <ip> --execute "create keyspace ycsb"
  2. $ ./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:

  1. hosts=<ip>
  2. port=9042
  3. 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.

  1. $ ./bin/ycsb load yugabyteCQL -P yugabyteCQL/db.properties -P workloads/workloada

Then, you can run the workload:

  1. $ ./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.

  1. $ ./bin/ycsb run yugabyteCQL -P yugabyteCQL/db.properties -P workloads/workloadb