HBaseUtils程序运行异常,
下面是报错信息
在虚拟机中查看ZK日志,发现已经连接,但是之后会异常退出,可能的原因是连接时间长被中断
但是HBase日志中没有任何连接信息。意味着连接到zk并分配session之后,程序并没有连接HBase
ZK日志如下
2017-12-06 11:51:11,307 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.43.233:52001
2017-12-06 11:51:11,313 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@839] - Client attempting to establish new session at /192.168.43.233:52001
2017-12-06 11:51:11,324 [myid:] - INFO [SyncThread:0:ZooKeeperServer@595] - Established session 0x16029dd9542000c with negotiated timeout 40000 for client /192.168.43.233:52001
程序报错后,并没有结束。继续卡住,过一段时间后exit 0 结束。此时ZK的日志文件增加
2017-12-06 11:59:46,211 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@354] - Exception causing close of session 0x16029dd9542000c due to java.io.IOException: Connection reset by peer
2017-12-06 11:59:46,215 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /192.168.43.233:52001 which had sessionid 0x16029dd9542000c
2017-12-06 12:00:26,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@325] - Expiring session 0x16029dd9542000c, timeout of 40000ms exceeded
2017-12-06 12:00:26,001 [myid:] - INFO [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@494] - Processed session termination for sessionid: 0x16029dd9542000c
这段时间程序的状态是:先报错,但程序没有中断,最后过了一会,程序中断
去查看HBase日志文件,发现这段时间没有任何程序连接HBase
SecurityAuth.audit
2017-12-06 11:51:03,821 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Auth successful for root (auth:SIMPLE)
2017-12-06 11:51:03,824 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Connection from 127.0.0.1 port: 52904 with version info: version: "1.2.0-cdh5.7.0" url: "file:///data/jenkins/workspace/generic-binary-tarball-and-maven-deploy/CDH5.7.0-Packaging-HBase-2016-03-23_11-28-41/hbase-1.2.0-cdh5.7.0" revision: "Unknown" user: "jenkins" date: "Wed Mar 23 11:46:29 PDT 2016" src_checksum: "91b52afd1a8dfc556696ed78433f5621"
2017-12-06 11:56:04,003 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Auth successful for root (auth:SIMPLE)
2017-12-06 11:56:04,004 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Connection from 127.0.0.1 port: 52956 with version info: version: "1.2.0-cdh5.7.0" url: "file:///data/jenkins/workspace/generic-binary-tarball-and-maven-deploy/CDH5.7.0-Packaging-HBase-2016-03-23_11-28-41/hbase-1.2.0-cdh5.7.0" revision: "Unknown" user: "jenkins" date: "Wed Mar 23 11:46:29 PDT 2016" src_checksum: "91b52afd1a8dfc556696ed78433f5621"
2017-12-06 12:01:03,849 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Auth successful for root (auth:SIMPLE)
2017-12-06 12:01:03,850 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Connection from 127.0.0.1 port: 53008 with version info: version: "1.2.0-cdh5.7.0" url: "file:///data/jenkins/workspace/generic-binary-tarball-and-maven-deploy/CDH5.7.0-Packaging-HBase-2016-03-23_11-28-41/hbase-1.2.0-cdh5.7.0" revision: "Unknown" user: "jenkins" date: "Wed Mar 23 11:46:29 PDT 2016" src_checksum: "91b52afd1a8dfc556696ed78433f5621"
2017-12-06 12:06:04,632 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Auth successful for root (auth:SIMPLE)
2017-12-06 12:06:04,633 INFO SecurityLogger.org.apache.hadoop.hbase.Server: Connection from 127.0.0.1 port: 53060 with version info: version: "1.2.0-cdh5.7.0" url: "file:///data/jenkins/workspace/generic-binary-tarball-and-maven-deploy/CDH5.7.0-Packaging-HBase-2016-03-23_11-28-41/hbase-1.2.0-cdh5.7.0" revision: "Unknown" user: "jenkins" date: "Wed Mar 23 11:46:29 PDT 2016" src_checksum: "91b52afd1a8dfc556696ed78433f5621"
HBase配置文件如下
但是在HBase shell中可以创建表,可以put进数据。
每次使用API调用就会报如上错误,因为是初学者。。所以2天了没有解决。求老师帮忙