美文网首页
Hbase 压测

Hbase 压测

作者: 专职掏大粪 | 来源:发表于2021-01-22 17:56 被阅读0次

    下载和安装YCSB

    wget https://github.com/brianfrankcooper/YCSB/releases/download/0.17.0/ycsb-hbase12-binding-0.17.0.tar.gz
    tar -zxvf ycsb-hbase12-binding-0.17.0.tar.gz
    source ~/.bash_profile
    

    及配置环境变量

    vi ~/.bash_profile
    export YCSB_HOME=/usr/local/datacenter/ycsb-hbase12-binding-0.17.0
    
    1. 创建 HBase 表
    hbase(main):001:0> n_splits = 200 # HBase recommends (10 * number of regionservers)
    hbase(main):002:0> create 'usertable', 'family', {SPLITS => (1..n_splits).map {|i| "user#{1000+i*(9999-1000)/n_splits}"}}
    
    1. 设置HBase配置文件
      1)在YCSB_HOME中创建conf目录,并在其中建立hbase-site.xml软链接或拷贝hbase-site.xml文件到YCSB_HOME/conf目录。
      2)把core-site.xml和hbase-site.xml也拷贝到$YCSB_HOME/conf目录下
    cp /usr/local/datacenter/hbase/conf/hbase-site.xml $YCSB_HOME/conf
    cp /usr/local/datacenter/hbase/conf/core-site.xml $YCSB_HOME/conf
    cp /usr/local/datacenter/hbase/conf/hdfs-site.xml $YCSB_HOME/conf
    

    3.加载数据

    bin/ycsb load hbase10 -P workloads/workloadh -p threads=50 -p table=usertable -p columnfamily=family -p recordcount=1000000 -s
    
    利用insertstart 多个client 并行
    bin/ycsb load hbase10 -P workloads/workloadh -p threads=50 -p table=usertable -p columnfamily=family -p insertstart=0 -p recordcount=10 -s
    
    bin/ycsb load hbase10 -P workloads/workloadh -p threads=50 -p table=usertable -p columnfamily=family -p insertstart=10 -p recordcount=10 -s
    

    4.查询

    bin/ycsb run hbase12 -P workloads/workloadh -threads 50 -p operationcount=1000000 -p table=usertable -p columnfamily=family -p measurementtype=timeseries -p timeseries.granularity=2000 -s
    

    https://github.com/brianfrankcooper/YCSB
    https://mp.weixin.qq.com/s/7mKA2azdXTF1bDrzcEdcRQ
    http://openinx.github.io/ppt/hbaseconasia2017_paper_18.pdf
    https://sq.163yun.com/blog/article/174952829785182208
    https://blog.csdn.net/zhangchen2449/article/details/53126884
    https://blog.csdn.net/weixin_34378969/article/details/91723144?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-2&spm=1001.2101.3001.4242

    相关文章

      网友评论

          本文标题:Hbase 压测

          本文链接:https://www.haomeiwen.com/subject/avsdzktx.html