错误1:
15/10/13 16:49:04 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:49:04 INFO util.RetryCounter: Sleeping 1000ms before retry #0...
15/10/13 16:49:05 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:49:06 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:49:06 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:49:06 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
15/10/13 16:49:07 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:49:08 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:49:08 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:49:08 INFO util.RetryCounter: Sleeping 4000ms before retry #2...
15/10/13 16:49:09 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
解决:
在createtable函数中加入这两句
HTableDescriptor htd =
new
HTableDescriptor(tablename) ;
HColumnDescriptor col =
new
HColumnDescriptor(
"content"
);
htd.addFamily(col);
Configuration cfg = HBaseConfiguration.create();
cfg.set("hbase.zookeeper.quorum","10.254.188.102, 10.254.188.103, 10.254.188.104");
cfg.set("hbase.zookeeper.property.clientPort","2181");
错误2:
15/10/13 16:42:53 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:42:54 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:42:54 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:42:54 INFO util.RetryCounter: Sleeping 1000ms before retry #0...
15/10/13 16:42:55 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:42:56 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:42:56 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:42:56 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
15/10/13 16:42:57 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:42:58 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:42:59 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:42:59 INFO util.RetryCounter: Sleeping 4000ms before retry #2...
15/10/13 16:43:00 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:43:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:43:02 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/13 16:43:03 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException
: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(
Native Method
)
at sun.nio.ch.SocketChannelImpl.finishConnect(
SocketChannelImpl.java:735
)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(
ClientCnxnSocketNIO.java:350
)
at org.apache.zookeeper.ClientCnxn$SendThread.run(
ClientCnxn.java:1081
)
15/10/13 16:43:03 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=localhost:2181,
exception=org.apache.zookeeper.KeeperException$ConnectionLossException
: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/10/13 16:43:03 INFO util.RetryCounter: Sleeping 8000ms before retry #3...
解决:
设置hbase.zookeeper.quorum和hbase.zookeeper.property.clientPort
Configuration conf =
new
Configuration();
conf.set( TableOutputFormat.
OUTPUT_TABLE
, tablename);
conf.set("hbase.zookeeper.quorum" , "10.254.188.102,10.254.188.103,10.254.188.104");
conf.set("hbase.zookeeper.property.clientPort" , "2181");//9091
错误3:
hbase windowns 下, Will not attempt to authenticate using SASL (无法定位登录配置)
INFO ClientCnxn:966 - Opening socket connection to server namenode/192.168.120.129:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
其实这个信息,并不是Hbase的异常,而是客户端找不到zookeeper的解析地址,由于Hbase是通过hostname解析IP地址的(DNS),Zookeeper只会返回Hbase的域名,需要客户端通过DNS或本地hosts文件进行解析。
解决办法:
在Linux上,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射,
在Windows上,修改C:Windowssystem32etchosts文件,添加Hbase Master节点的域名及IP地址映射。
解决办法:
在Linux上,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射,
在Windows上,修改C:Windowssystem32etchosts文件,添加Hbase Master节点的域名及IP地址映射。