Reputation: 8571
I am trying to use ycsb to carry out benchmarking of mongodb.
I have downloaded and installed mongo db as per instructions specified on YCSB MongoDB
After that I created "ycsb" named database in mongodb using below commands
1. use ycsb
2. db.createCollection("ycsb")
As specified in above link, I ran below command to load data into ycsb DB,
./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://127.0.0.1:27017 -p mongodb.database=ycsb
I just wanted to check load phase execution so I have not specified other parameters. I got below log on screen,
root@pegdb2:~/ycsb-0.1.4# ./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://127.0.0.1:27017 -p mongodb.database=ycsb
java -cp /root/ycsb-0.1.4/gemfire-binding/conf:/root/ycsb-0.1.4/infinispan-binding/conf:/root/ycsb-0.1.4/nosqldb-binding/conf:/root/ycsb-0.1.4/core/lib/core-0.1.4.jar:/root/ycsb-0.1.4/hbase-binding/conf:/root/ycsb-0.1.4/mongodb-binding/lib/mongodb-binding-0.1.4.jar:/root/ycsb-0.1.4/voldemort-binding/conf:/root/ycsb-0.1.4/jdbc-binding/conf com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.MongoDbClient -s -P workloads/workloada -p mongodb.url=mongodb://127.0.0.1:27017 -p mongodb.database=ycsb -load
YCSB Client 0.1
Command line: -db com.yahoo.ycsb.db.MongoDbClient -s -P workloads/workloada -p mongodb.url=mongodb://127.0.0.1:27017 -p mongodb.database=ycsb -load
Loading workload...
Starting test.
new database url = 127.0.0.1:27017/ycsb
0 sec: 0 operations;
mongo connection created with 127.0.0.1:27017/ycsb
java.lang.NullPointerException
0 sec: 0 operations; [INSERT AverageLatency(us)=28568]
[OVERALL], RunTime(ms), 143.0
[OVERALL], Throughput(ops/sec), 0.0
[INSERT], Operations, 1
[INSERT], AverageLatency(us), 28568.0
[INSERT], MinLatency(us), 28568
[INSERT], MaxLatency(us), 28568
[INSERT], 95thPercentileLatency(ms), 28
[INSERT], 99thPercentileLatency(ms), 28
[INSERT], Return=1, 1
[INSERT], 0, 0
[INSERT], 1, 0
[INSERT], 2, 0
[INSERT], 3, 0
[INSERT], 4, 0
[INSERT], 5, 0
[INSERT], 6, 0
[INSERT], 7, 0
[INSERT], 8, 0
[INSERT], 9, 0
[INSERT], 10, 0
.
.
[INSERT], 999, 0
[INSERT], >1000, 0
After this step I just wanted to check whether is loaded successfully in DB or not. I checked using,
1. use ycsb
2. db.ycsb.find()
but search results were 0. It might be a very easy question but it will be helpful if someone provides me the correct way to load and verify the data in DB.
Thanks for help.
Upvotes: 2
Views: 1300
Reputation: 8571
The problem was with one required parameter which I had not specified while loading the data.
mongodb.writeConcern is the parameter required while loading the data and running the workload. It should have one of following value,
-p mongodb.writeConcern=none
-p mongodb.writeConcern=strict
-p mongodb.writeConcern=normal
Generally -p mongodb.writeConcern=strict
works as it keeps session open and consistent. This also stops getting NPE errors.
After loading the data in MongoDB, data can be verified in usertable
table/collection using db.usertable.find()
or db.usertable.count()
commands.
Upvotes: 4