首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

HDFS+Zookeeper+Hbase异常

2013-06-26 
HDFS+Zookeeper+Hbase错误1、在安装Hbase时报如下错误:2013-06-13 20:11:34,749 INFO org.apache.zookeeper

HDFS+Zookeeper+Hbase错误
1、在安装Hbase时报如下错误:

2013-06-13 20:11:34,749 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:48725 (no session established for client)2013-06-13 20:11:34,749 INFO org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster: Started MiniZK Cluster and connect 1 ZK server on client port: 21812013-06-13 20:11:34,879 DEBUG org.apache.hadoop.hbase.master.HMaster: Set serverside HConnection retries=1002013-06-13 20:11:35,400 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start masterjava.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMasterCannot assign requested addressat org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:134)at org.apache.hadoop.hbase.LocalHBaseCluster.addMaster(LocalHBaseCluster.java:197)at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:147)at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:146)at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:104)at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2079)Caused by: java.net.BindException: Problem binding to /60.191.124.236:0 : Cannot assign requested addressat org.apache.hadoop.hbase.ipc.HBaseServer.bind(HBaseServer.java:258)at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.<init>(HBaseServer.java:482)at org.apache.hadoop.hbase.ipc.HBaseServer.<init>(HBaseServer.java:1559)at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.<init>(WritableRpcEngine.java:252)at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:201)at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:55)at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:330)at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:319)at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:306)at org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster.<init>(HMasterCommandLine.java:221)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)at java.lang.reflect.Constructor.newInstance(Constructor.java:513)at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:131)... 7 moreCaused by: java.net.BindException: Cannot assign requested addressat sun.nio.ch.Net.bind(Native Method)at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)at org.apache.hadoop.hbase.ipc.HBaseServer.bind(HBaseServer.java:256)... 21 more


原因是主机名没有绑定host,设置/etc/hosts,127.0.0.1 主机名
PS:如果按照下面的步骤操作,这个问题就可以避免。

接下来出现的几个问题基本都是和HOSTNAME有关系:
1、2012-11-12 16:41:39,099 [myid:] - INFO  [main-SendThread(x.x.x.x:2181):ClientCnxn$SendThread@966] - Opening socket connection to server x.x.x.x/x.x.x.x:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
2、ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times
3、ERROR: org.apache.hadoop.hbase.PleaseHoldException: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
这几个问题基本是和hosts配置有关,zookeeper对IP的支持也特别弱,再做关联的时候建议最好是HOSTNAME,具体的配置是:
在/etc/hosts中配置机器名和相应的IP(三台机器一样的配置):
192.168.16.133 namenode192.168.16.134 datanode1192.168.16.135 datanode2

PS:机器名不要映射到127.0.0.1上

在各个机器上分别中配置机器名:
vi /etc/sysconfig/networkHOSTNAME=namenodeHOSTNAME=datanode1HOSTNAME=datanode2


修改完后记得使设置生效,运行命令:hostname namenode、hostname datanode1、hostname datanode2,如果不行就重启机器;

接着就把所有配置文件的IP换成HOSTNAME。

另外还有很重要的一点就是服务器时间一定要同步,至少也要保证服务器时间相差不要太远。

以上操作完了,在把hdfs format一下,全部重新启动,hdfs->zookeeper->hbase。


热点排行