分享

habase启动错误及解决方案汇总

pig2 2013-12-12 01:11:10 发表于 总结型 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 44191


错误类型1:

错误内容如下:2013-11-12 23:28:31,575 WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnectjava.net.ConnectException: Connection refusedat sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)2013-11-12 23:28:31,675 WARN org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for hbasemaster2013-11-12 23:28:31,676 INFO org.apache.hadoop.hbase.util.RetryCounter: Sleeping 8000ms before retry #3...2013-11-12 23:28:31,676 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server slave002172.25.60.202:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
解决办法:
每个机器都系统时间首先相同,版本一致。再有就是hbase-default.xml 这个文件把所有节点都配进去。
错误类型2:
在XP eclipse中 做J2ee程序连接到 远程 Hbase 。出现异常:
  1. [cpt-service]16:34:47,851 INFO ZooKeeper:100 - Client environment:java.io.tmpdir=/home/hadoop/apache-tomcat-6/apache-tomcat-6.0.37/temp[cpt-service]16:34:47,852 INFO ZooKeeper:100 - Client environment:java.compiler=<NA>[cpt-service]16:34:47,852 INFO ZooKeeper:100 - Client environment:os.name=Linux[cpt-service]16:34:47,852 INFO ZooKeeper:100 - Client environment:os.arch=i386[cpt-service]16:34:47,853 INFO ZooKeeper:100 - Client environment:os.version=2.6.18-prep[cpt-service]16:34:47,853 INFO ZooKeeper:100 - Client environment:user.name=hadoop[cpt-service]16:34:47,853 INFO ZooKeeper:100 - Client environment:user.home=/home/hadoop[cpt-service]16:34:47,854 INFO ZooKeeper:100 - Client environment:user.dir=/home/hadoop/apache-tomcat-6/apache-tomcat-6.0.37/logs[cpt-service]16:34:47,856 INFO ZooKeeper:438 - Initiating client connection, connectString=node192:2181,node198:2181,node152:2181 sessionTimeout=180000 watcher=hconnection[cpt-service]16:34:47,862 DEBUG ClientCnxn:99 - zookeeper.disableAutoWatchReset is false[cpt-service]16:34:47,894 INFO RecoverableZooKeeper:104 - The identifier of this process is 6728@node198[cpt-service]16:34:47,900 INFO ClientCnxn:966 - Opening socket connection to server node198/10.2.0.198:2181. Will not attempt to authenticate using SASL (无法定位登录配置)[cpt-service]16:34:47,906 INFO ClientCnxn:849 - Socket connection established to node198/10.2.0.198:2181, initiating session[cpt-service]16:34:47,907 DEBUG ClientCnxn:889 - Session establishment request sent on node198/10.2.0.198:2181[cpt-service]16:34:47,907 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,909 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,913 INFO ClientCnxn:1207 - Session establishment complete on server node198/10.2.0.198:2181, sessionid = 0x40a7f8343b002d, negotiated timeout = 180000[cpt-service]16:34:47,915 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,916 DEBUG ZooKeeperWatcher:294 - hconnection Received ZooKeeper Event, type=None, state=SyncConnected, path=null[cpt-service]16:34:47,916 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,916 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,917 DEBUG ZooKeeperSaslClient:519 - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置[cpt-service]16:34:47,920 DEBUG ZooKeeperWatcher:371 - hconnection-0x40a7f8343b002d connected
复制代码


解决方法:
1、 配置hosts
由于Hbase是通过hostname解析IP地址的(DNS),Zookeeper只会返回Hbase的域名,需要客户端通过DNS或本地hosts文件进行解析。
若为Linux,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射
若为Windows,修改C:\Windows\system32\etc\hosts文件,添加Hbase Master节点的域名及IP地址映射。
2、做完这部继续运行
还有错误,看控制台信息,报:protobuf-java-2.4.0a.jar 该包未找到。去hbase server上将该包下载下来,加入 classpath ,运行,Debug中还有上述异常,但在最后可以查询出hbase中的值。
3、将Log4J配置文件改为 INFO级别。继续运行。异常信息没有。
4、将 protobuf-java.jar 删除,继续运行该项目,也不抱异常了。查询一切正常。

错误类型3:

把代码拷贝到Hadoop的lib下面,然后在命令行中运行,遇到的一个问题如下:
  • 12/09/29 12:29:36 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
  • 12/09/29 12:29:36 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
  • 12/09/29 12:29:36 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
  • 12/09/29 12:29:36 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 6479@fansyPC
  • 12/09/29 12:29:36 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
  • java.net.ConnectException: 拒绝连接
  • at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
  • at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692)
  • at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286)
  • at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1035)
  • 12/09/29 12:29:36 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master

配置如下:


  1. <configuration>  
  2.     <property>  
  3.         <name>hbase.rootdir</name>  
  4.         <value>hdfs://fansyPC:9000/hbase</value>  
  5.     </property>  
  6.     <property>  
  7.         <name>hbase.cluster.distributed</name>  
  8.         <value>true</value>  
  9.     </property>  
  10.       
  11.     <property>  
  12.         <name>hbase.zookeeper.quorum</name>  
  13.         <value>slave1</value>  
  14.     </property>  
  15.       
  16.     <property>  
  17.         <name>hbase.zookeeper.property.dataDir</name>  
  18.         <value>/home/fansy/zookeeper</value>  
  19.     </property>  
  20.       
  21. </configuration>
复制代码




解决方案:
要Ubuntu的系统有点不同的,所以改了下:
/etc/security/limits.conf  :
添加这两句:
1.hadoop - nofile 32768  
2.hadoop soft/hard nproc 32000  
/etc/pam.d/common-session:
session required pam_limits.so
hbase.zookeeper.quorum
配置不能和slave节点机在一个上面?所以我就又改了这个值 ,全部改为 fansyPC了,同时根据官方文档上面说要用hbase/lib下面的hadoop-core-1.0.2.jar 去代替haoop/下面的hadoop-core-1.0.2.jar这个文件,最后把hbase/lib下面的JAR包都放在了hadoop/lib下面(重复的跳过),然后就Ok了



错误类型4:
Master上的HMaster服务老是自动死掉, 看错误日志只是提示连接失败Session 0x0 for server null
解决方法:
1. 关闭IP6    , 修改/etc/hosts   注视以"::1 "开头的
2. 校准HBase集群Zookeeper集群机器的时间,误差30秒以内
重启机器.ok


没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条