HBase常用参数、命令笔记

设置读HBase Mapper多线程数量

hbase.mapreduce.multithreadedmapper.threads

 

hbase scanner 打印日志

hbase.client.log.scanner.activity   //是否打印日志

hbase.mapreduce.log.scanner.rowcount   //每scan多少条数据打印一次日志

hbase.client.scanner.timeout.period   //scan timeout 默认600000(10min)

 

在线更新hbase配置

update_all_config, update_config

 

rowKey长度限制

32767

 

读写缓存

hbase.regionserver.global.memstore.size=0.4

hfile.block.cache.size=0.4

相加不能超过0.8

 

Hbase regionserver 所有region的memstore超过这个阈值:

regionserverHeapSize*hbase.regionserver.global.memstore.size* hbase.regionserver.global.memstore.size.lower.limit

就会触发该rs上所有memstore的强制刷写(flush)

 

阻塞StoreFile数量配置

hbase.hstore.blockingStoreFiles

当storefile数量达到配置时,会导致flush阻塞等到compaction工作完成。阻塞时间是hbase.hstore.blockingWaitTime。

 

Flush线程数

hbase.hstore.flusher.count

 

阻塞写入时,memstore内存大小系数

hbase.hregion.memstore.block.multiplier

 

region最大HFile大小

hbase.hregion.max.filesize   //超过该配置,会导致region分裂

 

合并大文件线程数量

hbase.regionserver.thread.compaction.large

 

合并小文件线程数量

hbase.regionserver.thread.compaction.small

 

HBase RowCounter

hbase org.apache.hadoop.hbase.mapreduce.RowCounter  'vsearch_link_v2'

 

分区文件路径

mapreduce.totalorderpartitioner.path

使用bulkload无需上传hbase表分区文件,HFileOutputFormat2.configureIncrementalLoad(job, table, table.getRegionLocator()) 会自动根据table的region边界生成分区文件,并存放在hbase.fs.tmp.dir配置目录下。

 

hbase任务的临时目录

hbase.fs.tmp.dir

 

hbase在线修复数据

hbase hbck

 

hbase离线修复数据

hbase org.apache.hadoop.hbase.util.hbck.OfflineMetaRepair –fix

 

hbase动态添加节点

1.在hmaster节点上添加regionservers配置

2.在新的regionserver节点上启动regionservers节点

bin/hbase-deamon.sh start regionserver

 

hbase动态删除节点

1.关闭负载均衡器

hbase shell中执行命令balance_switch false

2.需要关闭的regionserver上执行命令

bin/hbase-deamon.sh stop regionserver

或者执行命令

bin/graceful_stop.sh <HostName>

 

Bulkload导入StoreFile

  1. 命令行:hadoop jar hbase-server-VERSION.jar completebulkload [-c /path/to/hbase/config/hbase-site.xml] /user/todd/myoutput mytable
  2. java代码编程导入使用LoadIncrementalHFiles。
  3. importtsv见https://hbase.apache.org/book.html#arch.bulk.load.adv

 

Hbase Scan超时时间配置

hbase.client.scanner.timeout.period=600000

单位是毫秒

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值