Update May 2012: Some or all of this will be outdated now because the latest versions of YCSB are using Maven. I haven’t updated this article to reflect this.
I assume most of you know what HBase is but just in case here is a snippet from Wikipedia:
HBase is an open source, non-relational, distributed database modeled after Google’s BigTable and is written in Java.
Yahoo has published a paper and the accompanying tool (YCSB) about Benchmarking Cloud Serving Systems with YCSB. At the moment I am not interested in comparing different database systems against each other but instead to only benchmark HBase. This is useful to test custom patches and their performance impact or to test different configuration options.
No matter which kind of workload you choose however keep in mind that this is an artificial benchmark and it can’t replace a test with your real data and load.
In this short blog post I’m going to outline how to get YCSB running against a current version of HBase. I’m going to show this on a single machine. In a real test setup you should of course be running YCSB on a different machine (or multiple machines) than your HBase cluster. A YCSB benchmark consists of two phases: a load and a transaction phase. The load phase measures various statistics while importing a bunch of data into the database while the transaction phase does just that, i.e. transactions on the data. There are multiple predefined workloads that mimic typical database usage scenarios and you can also define your own.
Requirements/Setup
I am using a clean Ubuntu 10.04 installation but this should work on other distributions just as well.
While you’ll probably run it against an already set up cluster I will be using HBase in standalone mode here in its second development release of 0.89.
For YSCB I’ve used the latest version checked out from Github but the latest released version (0.1.2 at the time of this writing) should work equally well. So do this:
$ sudo apt-get -y install ant openjdk-6-jdk git-core $ export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/ $ wget http://apache.easy-webs.de/hbase/hbase-0.89.20100726/hbase-0.89.20100726-bin.tar.gz $ tar xvzf hbase-0.89.20100726-bin.tar.gz $ hbase-0.89.20100726/bin/start-hbase.sh $ hbase-0.89.20100726/bin/hbase shell create 'usertable', 'family' exit $ git clone http://github.com/brianfrankcooper/YCSB.git $ cp hbase-0.89.20100726/lib/* YCSB/db/hbase/lib $ cd YCSB $ ant $ ant dbcompile-hbase
As you can see YCSB requires a table called usertable in HBase and it has to contain one column family with an arbitrary name (i.e. family in my case). YCSB also needs all the libraries (jars) that the HBase client needs to run. The easiest is to just copy everything from HBase’s lib directory to the appropriate directory in YCSB.
Running YCSB
At this point we should have HBase running somewhere and YCSB and its HBase driver compiled. Time to load some data into HBase.
java -cp build/ycsb.jar:db/hbase/lib/* com.yahoo.ycsb.Client -load -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -p recordcount=1000 -s > load.dat
A few things to note here:
- This loads only 1000 records into HBase. You will want to increase the number to 100 million or more on a real test.
- The documentation is pretty good so make sure to read it should you have problems.
- The documentation suggests not specifying properties (like recordcount) on the command line but in a property file instead. You’ll find instructions on how to do this on the aforementioned page.
- The
-sparameter causes YCSB to print status messages to System.err every ten seconds, remove it if you don’t want them. - After the load operation has finished you can find statistics in the
load.datfile
Now we’ll run the transactions part of the workload (again, for explanations see the documentation of YCSB):
java -cp build/ycsb.jar:db/hbase/lib/* com.yahoo.ycsb.Client -t -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -p operationcount=1000000 -s -threads 10 -target 100 > transactions.dat
or
java -cp build/ycsb.jar:db/hbase/lib/* com.yahoo.ycsb.Client -t -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -p operationcount=1000000 -s -threads 10 -target 100 -p measurementtype=timeseries -p timeseries.granularity=2000 > transactions.dat
After each run you should inspect the transactions.dat file. For explanations I’ll once again refer to the documentation. We’ve used workloada in these examples but there are in fact multiple predefined workloads (which are listed and explained in the documentation).
That’s it. As you can see YCSB is pretty easy to set up. I still hope this guide was helpful in getting started with it. Let me know if you have any questions.
Hi! Thanks for the post, very useful. I’m tryin to run the workload as specified in a machine apart from the cluster and it can’t get zookeeper connected. Any idea about that specific parameter?
Thanks in advance!
I’m sorry for answering only now.
So you have a HBase cluster running somewhere and now you’re trying to run YCSB from another machine but it doesn’t work because it can’t connect to ZooKeeper?
If so try to copy your hbase-site.xml config from your cluster in the classpath of YCSB and try again.
To reply to myself:
Copy your
hbase-site.xmlwith all the configuration options to thedb/hbase/confdirectory and add it to your classpath like this:java -cp "build/ycsb.jar:db/hbase/lib/*:db/hbase/conf/" ...Hi , thanks for share this , it is very useful. I follow your introduction to do hbase performance test with below command, I can see the output , but there is no data insert into usertable. it look like no data insert into hbase, but why I can still get AverageLatency of update operation.
Command:
java -cp /home/bill/dev/hadoop/YCSB/build/ycsb.jar:hbase-0.90.0/lib/*:hbase-0.90.0/conf/ com.yahoo.ycsb.Client -t -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -p operationcount=1000000 -s -threads 10 -target 100 > transactions.dat
YCSB result:
11/02/25 17:51:07 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/bill/dev/hadoop/YCSB
11/02/25 17:51:07 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=10.50.11.168:2181 sessionTimeout=180000 watcher=hconnection
11/02/25 17:51:07 INFO zookeeper.ClientCnxn: Opening socket connection to server /10.50.11.168:2181
11/02/25 17:51:08 INFO zookeeper.ClientCnxn: Socket connection established to dc0sfperf02-app09/10.50.11.168:2181, initiating session
11/02/25 17:51:08 INFO zookeeper.ClientCnxn: Session establishment complete on server dc0sfperf02-app09/10.50.11.168:2181, sessionid = 0x12e5c32ebda0007, negotiated timeout = 180000
10 sec: 131 operations; 13.1 current ops/sec; [UPDATE AverageLatency(ms)=389.39] [READ AverageLatency(ms)=1090.95]
20 sec: 464 operations; 33.3 current ops/sec; [UPDATE AverageLatency(ms)=0.13] [READ AverageLatency(ms)=633.08]
30 sec: 759 operations; 29.5 current ops/sec; [UPDATE AverageLatency(ms)=0.05] [READ AverageLatency(ms)=632.69]
40 sec: 1062 operations; 30.3 current ops/sec; [UPDATE AverageLatency(ms)=0.07] [READ AverageLatency(ms)=636.93]
50 sec: 1381 operations; 31.9 current ops/sec; [UPDATE AverageLatency(ms)=0.12] [READ AverageLatency(ms)=634.26]
60 sec: 1685 operations; 30.4 current ops/sec; [UPDATE AverageLatency(ms)=0.09] [READ AverageLatency(ms)=642.77]
[...] 原文链接:http://blog.lars-francke.de/2010/08/16/performance-testing-hbase-using-ycsb/ [...]
Hi , this post is very good, and its helpful for me to check my hbase performance. I am using hbase on single machine in pseudo distributed mode. hadoop-0.20.2 and hbase-0.90.4 . To run ycsb benchmark on my machine, I followed till the last command i.e
ant
it worked well, but, when i executed
ant dbcompile-hbase
i got following errors. It is showing errors in build.xml so, i couldn’t solve it. please help me to overcome these errors and successfully run ycsb benchmark.
hduser@vamshi-laptop:~/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e$ ant dbcompile-hbase
Buildfile: build.xml
compile:
makejar:
BUILD FAILED
/home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build.xml:41: The following error occurred while executing this line:
/home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build.xml:58: /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build/ycsb.jar is read-only.
Total time: 0 seconds
so i ran the same in with sudo before command.
hduser@vamshi-laptop:~/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e$ sudo ant dbcompile-hbase
Buildfile: build.xml
compile:
makejar:
dbcompile-hbase:
dbcompile:
[javac] Compiling 1 source file to /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build/classes
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:30: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.HTable;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:32: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.Get;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:33: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.Put;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:34: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.Delete;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:35: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.Scan;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:36: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.Result;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:37: package org.apache.hadoop.hbase.client does not exist
[javac] import org.apache.hadoop.hbase.client.ResultScanner;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:40: package org.apache.hadoop.hbase.util does not exist
[javac] import org.apache.hadoop.hbase.util.Bytes;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:41: package org.apache.hadoop.hbase does not exist
[javac] import org.apache.hadoop.hbase.HBaseConfiguration;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:51: cannot find symbol
[javac] symbol : class HTable
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] public HTable _hTable=null;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:80: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] _columnFamilyBytes = Bytes.toBytes(_columnFamily);
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:102: cannot find symbol
[javac] symbol : class HBaseConfiguration
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] HBaseConfiguration config = new HBaseConfiguration();
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:102: cannot find symbol
[javac] symbol : class HBaseConfiguration
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] HBaseConfiguration config = new HBaseConfiguration();
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:103: cannot find symbol
[javac] symbol : class HTable
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] _hTable = new HTable(config, table);
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:138: cannot find symbol
[javac] symbol : class Result
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Result r = null;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:145: cannot find symbol
[javac] symbol : class Get
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Get g = new Get(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:145: cannot find symbol
[javac] symbol : class Get
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Get g = new Get(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:145: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Get g = new Get(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:162: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] byte[] value = r.getValue(_columnFamilyBytes, Bytes.toBytes(field));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:163: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] result.put(field,Bytes.toString(value));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:165: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] System.out.println(“Result for field: “+field+” is: “+Bytes.toString(value));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:199: cannot find symbol
[javac] symbol : class Scan
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Scan s = new Scan(Bytes.toBytes(startkey));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:199: cannot find symbol
[javac] symbol : class Scan
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Scan s = new Scan(Bytes.toBytes(startkey));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:199: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Scan s = new Scan(Bytes.toBytes(startkey));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:213: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] s.addColumn(_columnFamilyBytes,Bytes.toBytes(field));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:218: cannot find symbol
[javac] symbol : class ResultScanner
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] ResultScanner scanner = null;
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:222: cannot find symbol
[javac] symbol : class Result
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] for (Result rr = scanner.next(); rr != null; rr = scanner.next())
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:225: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] String key = Bytes.toString(rr.getRow());
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:237: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] byte[] value = rr.getValue(_columnFamilyBytes,Bytes.toBytes(field));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:238: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] rowResult.put(field,Bytes.toString(value));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:241: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] System.out.println(“Result for field: “+field+” is: “+Bytes.toString(value));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:251: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] String value = Bytes.toString(scanMap.get(fieldkey));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:252: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] rowResult.put(Bytes.toString(fieldkey),value);
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:255: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] System.out.println(“Result for field: “+Bytes.toString(fieldkey)+” is: “+value);
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:317: cannot find symbol
[javac] symbol : class Put
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Put p = new Put(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:317: cannot find symbol
[javac] symbol : class Put
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Put p = new Put(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:317: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Put p = new Put(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:324: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] p.add(_columnFamilyBytes,Bytes.toBytes(entry.getKey()),Bytes.toBytes(entry.getValue()));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:324: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] p.add(_columnFamilyBytes,Bytes.toBytes(entry.getKey()),Bytes.toBytes(entry.getValue()));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:389: cannot find symbol
[javac] symbol : class Delete
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Delete d = new Delete(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:389: cannot find symbol
[javac] symbol : class Delete
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Delete d = new Delete(Bytes.toBytes(key));
[javac] ^
[javac] /home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java:389: cannot find symbol
[javac] symbol : variable Bytes
[javac] location: class com.yahoo.ycsb.db.HBaseClient
[javac] Delete d = new Delete(Bytes.toBytes(key));
[javac] ^
[javac] 42 errors
BUILD FAILED
/home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build.xml:28: The following error occurred while executing this line:
/home/hduser/Documents/HBASE_SOFTWARE/brianfrankcooper-YCSB-8d3aa2e/build.xml:51: Compile failed; see the compiler error output for details.
even am getting the same error!..any help?
Even i got the error. Needed to copy the hbase-0.XX.0.jar from the top level hbase directory (above lib) to ycsb/db/hbase/lib/ to ward off this problem
Hi!
very useful post! but actually I still have problem with HBase… I’m launching ycsb like this:
java -cp build/ycsb.jar:db/hbase/lib/hadoop-core-0.20-append-r1056497.jar:db/hbase/lib/hbase-0.90.4.jar:db/hbase/lib/commons-logging-1.1.1.jar:db/hbase/lib/zookeeper-3.3.2.jar:db/hbase/lib/log4j-1.2.16.jar:db/habase/conf/ com.yahoo.ycsb.Client -load -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -s
and I’ve got:
YCSB Client 0.1
Command line: -load -db com.yahoo.ycsb.db.HBaseClient -P workloads/workloada -p columnfamily=family -s
Loading workload…
Starting test.
11/11/26 21:31:14 WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration
0 sec: 0 operations;
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.2-1031432, built on 11/05/2010 05:32 GMT
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:host.name=julio-System-Product-Name
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_22
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-6-openjdk/jre
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.class.path=build/ycsb.jar:db/hbase/lib/hadoop-core-0.20-append-r1056497.jar:db/hbase/lib/hbase-0.90.4.jar:db/hbase/lib/commons-logging-1.1.1.jar:db/hbase/lib/zookeeper-3.3.2.jar:db/hbase/lib/log4j-1.2.16.jar:db/habase/conf/
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:java.compiler=
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.38-11-generic-pae
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:user.name=julio
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/julio
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/julio/inz/YCSB
11/11/26 21:31:14 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
11/11/26 21:31:14 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
11/11/26 21:31:14 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
11/11/26 21:31:14 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x133e11517d60011, negotiated timeout = 40000
10 sec: 0 operations;
20 sec: 0 operations;
30 sec: 0 operations;
if it will be helpful I can not create column family under hbase and even stop it. Do you have any idea what might be wrong? Previously i was successful to run cassandra with ycsb.
About hbase shell I got:
julio@julio-System-Product-Name:~/inz/YCSB$ hbase-0.90.4/bin/hbase shell
HBase Shell; enter ‘help’ for list of supported commands.
Type “exit” to leave the HBase Shell
Version 0.90.4, r1150278, Sun Jul 24 15:53:29 PDT 2011
hbase(main):001:0> create ‘usertable’, ‘data’
ERROR: org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException: org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException: Timed out (10000ms)
Here is some help for this command:
Create table; pass table name, a dictionary of specifications per
column family, and optionally a dictionary of table configuration.
Dictionaries are described below in the GENERAL NOTES section.
Examples:
hbase> create ‘t1′, {NAME => ‘f1′, VERSIONS => 5}
hbase> create ‘t1′, {NAME => ‘f1′}, {NAME => ‘f2′}, {NAME => ‘f3′}
hbase> # The above in shorthand would be the following:
hbase> create ‘t1′, ‘f1′, ‘f2′, ‘f3′
hbase> create ‘t1′, {NAME => ‘f1′, VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
please help me!
best regards
Julio
Julio,
You need to copy the configuration files from /etc/hbase/conf/* to YCSB/db/hbase/conf/
Cheers,
Sunil Reddy
Thanks for all the wonderful information here. I am trying to run the tool and running into the following exception:
[root@salmana-linux build]# java -cp “ycsb.jar:db/hbase/lib/*:db/hbase/conf/” com.yahoo.ycsb.Client -load -db com.yahoo.ycsb.db.HBaseClient -P /local/mnt/YCSB/workloads/workloada -p columnfamily=family -p recordcount=1000 -s
YCSB Client 0.1
Command line: -load -db com.yahoo.ycsb.db.HBaseClient -P /local/mnt/YCSB/workloads/workloada -p columnfamily=family -p recordcount=1000 -s
Loading workload…
Starting test.
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at com.yahoo.ycsb.DBFactory.newDB(Unknown Source)
at com.yahoo.ycsb.Client.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
… 7 more
[root@salmana-linux build]#
Sal,
Please copy the Hadoop and HBase jar to YCSB lib directory
cp /usr/lib/hadoop-0.20/lib/* /local/mnt/YCSB/
cp /usr/lib/hbase/lib/* /local/mnt/YCSB/
Thank You,
Sunil Reddy
Hi,
Thank for that helpful information.
I get an error while tring to clone into the git folder.
The error is as follows:
fatal: http://gitub.com/brianfrankcooper/YCSB.git/info/refs not valid: is this a git repository?
Could you please help me with this?
Sorry, it is working. The spelling was wrong!