ITPub博客

首页 > 大数据 > > YCSB 对HBase 性能测试

YCSB 对HBase 性能测试

作者:浪花小雨滴 时间:2020-05-18 16:12:08 0 删除 编辑

最近公司要求测试hbase性能,于是和运维同事协商,从公司过保,废弃的6台服务器上,搭起了一个hbase测试集群。

 HBase的版本是:0.90.3 Hadoop的版本是:0.20.2,分布式部署,hbase一共4个节点,hadoop是单独的16个节点。数据存放在hadoop中。
测试工具是:YCSB,yahoo cloud system benchmark。专用于对各种分布式数据库测试的工具。可以在这个网站上下载:https://github.com/brianfrankcooper/YCSB,  YCSB更多的是用来测试不同分布式数据库的,如cassandra,hypertable,HBase,考察不同数据库的相关性能。

下载测试工具:
我使用的版本是:ycsb-0.1.4
wget https://github.com/downloads/brianfrankcooper/YCSB/ycsb-0.1.4.tar.gz
tar xfvz ycsb-0.1.4.tar.gz
cd ycsb-0.1.4

开始配置测试环境:

~/ycsb-0.1.4/hbase-binding/conf$ vim hbase-site.xml


 
    hbase.rootdir
    hdfs://hmaster:9000/hbase
    The directory shared by region servers.
   

 

 
    hbase.master
    hmaster:60000
    The host and port that the HBase master runs at.
   

 

 
    hbase.zookeeper.quorum
    hbas1,hbase2,hbase3,hbase4,hbase5,hbase6
    <!-- -->
 


数据清理:
/bin/hbase shell
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.90.3, r1100350, Sat May  7 13:31:12 PDT 2011

hbase(main):001:0> status
6 servers, 0 dead, 124.0000 average load

hbase(main):010:0> drop 'usertable' ERROR: Table usertable does not exist.' Here is some help for this command: Drop the named table. Table must first be disabled. If table has more than one region, run a major compaction on .META.:
hbase(main):002:0> create 'usertable', 'family','f1','f2', 'f3','f4','f5','f6','f7','f8' 0 row(s) in 0.2560 seconds hbase(main):003:0> count 'usertable' 0 row(s) in 0.0680 seconds

YCSB需要在HBase中创建一张叫usertable的表,表中包含一个Column Family,CF的名字可自定义。

现在加载10000行数据
bin/ycsb load hbase -P workloads/workloada  -p columnfamily=family -p recordcount=10000 -s -threads 10 -p measurementtype=timeseries -p timeseries.granularity=2000 > fengload.log

............................


现在执行run:

./bin/ycsb run hbase -P workloads/workloada -p columnfamily=family -p recordcount=10000 -threads 10 -p measurementtype=timeseries -p timeseries.granularity=2000 -load -s > feng_transactions.dat


重要参数简介:
operationcount :事务数,默认是10000
事务最大扫描数(maxscanlength) 默认是1000


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8183550/viewspace-750949/,如需转载,请注明出处,否则将追究法律责任。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31537575/viewspace-3131214/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2018-05-16

  • 博文量
    4259
  • 访问量
    39921