hbase在zk上的目录简介

都知道hbase依赖于zookeeper集群的,但是到底在zk上存了什么信息。
连接到zk客户端:
cd 到 zk的bin目录下面,连接zk客户端:zookeeper-client
连接上后查看根节点下面有哪些节点: ls /
发现有一个hbase节点,查看该节点下面的节点,ls /hbase
发现节点如下:
meta-region-server 该节点储存信息:元数据存储的RegionServer地址。
rs 集群运行的RegionServer地址
master/backup-masters Hbase集群中的高可用
table 集群中所有表信息
region-in-transition 在Region迁移时,记录Region的变更状态,Master监听此节点,来获取Region的状态
table-lock 表锁,在对一张表做DDL操作时,充当分布式表锁,保证DDL操作的顺序
replication Hbase的复制功能
splitWAL/recovering-regions 故障恢复使用
online-snapshot 快照操作

当使用HBaseTemplate查询HBase时,如果遇到ZooKeeper报超时的情况,可以尝试以下几种方法: 1. 增加ZooKeeper的超时时间。可以在HBase配置文件中(hbase-site.xml)中增加以下配置: ``` <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> <property> <name>hbase.zookeeper.property.maxClientCnxns</name> <value>300</value> </property> <property> <name>hbase.zookeeper.property.tickTime</name> <value>6000</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/hadoop/zookeeper</value> </property> <property> <name>hbase.zookeeper.property.clientPortAddress</name> <value>0.0.0.0</value> </property> ``` 其中,hbase.zookeeper.property.tickTime 表示ZooKeeper的心跳时间,单位为毫秒,可以根据实际情况进行调整;hbase.zookeeper.property.maxClientCnxns 表示ZooKeeper客户端的最大连接数,可以根据实际情况进行调整。 2. 增加HBase客户端的超时时间。可以在HBaseTemplate中增加以下配置: ``` @Configuration public class HBaseConfiguration { @Bean public HbaseTemplate hbaseTemplate() { Configuration configuration = HBaseConfiguration.create(); configuration.set("hbase.client.operation.timeout", "30000"); configuration.set("hbase.rpc.timeout", "30000"); configuration.set("hbase.client.scanner.timeout.period", "30000"); return new HbaseTemplate(configuration); } } ``` 其中,hbase.client.operation.timeout、hbase.rpc.timeout、hbase.client.scanner.timeout.period 分别表示客户端操作的超时时间、RPC请求的超时时间、Scanner扫描的超时时间,可以根据实际情况进行调整。 3. 检查ZooKeeper服务是否正常运行。可以通过zkCli.sh命令进入ZooKeeper命令行界面,执行"ls /"命令查看ZooKeeper是否正常运行。 以上是解决HBase查询中ZooKeeper报超时的几种方法,可以根据实际情况进行选择。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值