命令行运行Hbase: Session 0x0 for server null, unexpected error

又重新看了下hbase的操作,以前虽说是运行过对Hbase的操作,比如直接的建表,导入数据,或者是使用MR操作Hbase,但是都是在单节点上做的,而且是用eclipse下操作的,不用担心一些包的问题。今天打算把代码拷贝到Hadoop的lib下面,然后在命令行中运行,遇到的一个问题如下:

  1. 12/09/29 12:29:36 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection 
  2. 12/09/29 12:29:36 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181 
  3. 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. 
  4. 12/09/29 12:29:36 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 6479@fansyPC 
  5. 12/09/29 12:29:36 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect 
  6. java.net.ConnectException: 拒绝连接 
  7.     at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
  8.     at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692
  9.     at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286
  10.     at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1035
  11. 12/09/29 12:29:36 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master 

看到这个提示,第一次感觉是不是我配置错了?怎么显示的是127.0.0.1的机子呢?应该是其他节点机或者是本机的计算机名字才对的吧,这样就好像是单机启动一样。我的配置如下:

  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了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值