Hbase 错误ERROR记录


  
  
2013-06-27 16:14:21,899 FATAL org.apache.hadoop.hbase.regionserver.HRegionServer: Master rejected startup because clock is out of sync
org.apache.hadoop.hbase.ClockOutOfSyncException: org.apache.hadoop.hbase.ClockOutOfSyncException: Server hadoopslave2,60020,1372320861420 has been rejected; Reported time is too far out of sync with master.  Time difference of 143732ms > max allowed of 30000ms
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:95)
        at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:79)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.reportForDuty(HRegionServer.java:2093)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:744)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hbase.ClockOutOfSyncException: Server hadoopslave2,60020,1372320861420 has been rejected; Reported time is too far out of sync with master.  Time difference of 143732ms > max allowed of 30000ms

错误点:FATAL org.apache.hadoop.hbase.regionserver.HRegionServer: Master rejected startup because clock is out of sync
org.apache.hadoop.hbase.ClockOutOfSyncException: org.apache.hadoop.hbase.ClockOutOfSyncException: Server hadoopslave2,60020,1372320861420 has been rejected; Reported time is too far out of sync with master.  Time difference of 143732ms > max allowed of 30000ms

原因:时间不一致造成的

解决方案1:

配置:hbase.master.maxclockske

	<property>
                 <name>hbase.master.maxclockskew</name>
                 <value>200000</value>
                 <description>Time difference of regionserver from master</description>
        </property>

解决方案2:

修改个节点时间:

http://eryk.iteye.com/blog/1064591

#!/bin/bash  
echo "start"  
for ((i=211;i<=218;i++))  
do  
  
#ssh 192.168.5.${i} 'date 110415402010; clock -w'  
ssh 192.168.5.$i 'date -s "2011-05-10 10:44:00"; clock -w'  
#ssh 192.168.210.${machine} 'clock -w'  
done  
echo "complete"  


### HBase 使用指南与常见问题解析 HBase 是一种分布式的、面向列的开源数据库,适用于大规模数据存储和实时读写场景。以下是关于 HBase 的安装、配置、使用以及常见问题的相关信息。 #### 一、HBase 安装与配置 为了成功部署 HBase 并使其正常运行,需遵循以下步骤: 1. **环境准备** - 确保已安装 Java JDK (建议版本为 8 或更高)[^2]。 - 配置好 Hadoop 和 ZooKeeper 环境,因为 HBase 依赖它们进行分布式管理和协调[^3]。 2. **下载与解压** - 下载最新稳定版的 HBase 软件包,并将其解压缩至目标目录[^1]。 3. **修改配置文件** - 编辑 `hbase-site.xml` 文件以设置必要的属性,例如指定 HDFS 数据存储位置和 ZooKeeper 地址[^1]。 ```xml <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://namenode:8020/hbase</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>zookeeper1,zookeeper2,zookeeper3</value> </property> </configuration> ``` 4. **启动服务** - 启动 HBase 主节点 (`HMaster`) 和区域服务器 (`HRegionServer`)。可以通过执行如下命令完成: ```bash $ ./bin/start-hbase.sh ``` - 此外,还需确认 ZooKeeper 是否处于活动状态[^3]。 5. **验证服务状态** - 访问 Web UI 页面,默认地址为 http://<master-ip>:16010/ 来检查集群健康状况[^1]。 - 利用 HBase Shell 测试基本功能: ```bash $ ./bin/hbase shell hbase(main):001:0> status ``` --- #### 二、HBase 常见问题及解决方案 1. **无法找到 Master 地址** 如果在尝试创建表或查询状态时收到错误提示:“ERROR: Can't get master address from ZooKeeper”,则表明可能存在以下原因之一: - HMaster 进程尚未正确初始化; - ZooKeeper 中缺少有效的 ZNode 数据。 对策包括重新启动整个 HBase 集群并清理残留的日志记录。 2. **JVM 参数不兼容** 当观察到类似 “ignoring option PermSize=128m; support was removed in 8.0” 的警告消息时,说明当前使用的 JVM 已废弃某些旧选项。推荐更新相关脚本中的 JAVA_OPTS 设置部分,移除过时条目。 3. **性能调优技巧** - 提高 RegionServer 写缓冲区大小可以减少磁盘 I/O 开销[^2]: ```properties hbase.regionserver.global.memstore.upperLimit=0.4 ``` - 减少预取扫描范围有助于提升随机访问效率[^2]: ```properties hbase.client.scanner.caching=100 ``` 4. **与其他框架集成** Apache Flink 提供了一个专门针对 HBase 设计的数据流接口,允许开发者轻松实现批量导入导出任务[^4]。下面展示了一段简单的 Python 实现案例: ```python import happybase connection = happybase.Connection('localhost') table = connection.table('my_table') row_key = 'row1' data = {'cf:col': b'value'} table.put(row_key, data) result = table.row(row_key) print(result[b'cf:col']) ``` --- #### 三、总结 通过对 HBase 的学习掌握其基础架构特点之后,在实际操作过程中难免会遭遇各类挑战。然而凭借详尽的技术文档支持加上社区活跃贡献者的协助,大多数难题都能够迎刃而解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值