public static void main(String[] args) throws IOException {
HTable table = null;
Configuration conf = new Configuration();
conf.set("hbase.zookeeper.quorum", "vmdev40");
conf.set("hbase.zookeeper.property.clientPort", "2181");
table = new HTable(conf,
"HB_MENU");
Get get = new Get(Bytes.toBytes(191019764));
Result r= table.get(get);
System.out.println(resultToString(r));
table.close();
}
简单的一个get代码,但每次程序退出后,regionserver都会报下面这个警告,虽然功能上没有关系,但总是很碍眼,有什么办法解决吗?
估计是HBaseServer$Listener$Reader在阻塞读套接字数据,但是客户端退出关闭连接,所以报了这个异常。
2013-01-08 13:38:45,896 WARN org.apache.hadoop.ipc.HBaseServer: IPC Server listener on 60020: readAndProcess threw exception java.io.IOException: Connection reset by peer. Count of bytes read: 0
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:198)
at sun.nio.ch.IOUtil.read(IOUtil.java:171)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)
at org.apache.hadoop.hbase.ipc.HBaseServer.channelRead(HBaseServer.java:1676)
at org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1120)
at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:703)
at org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:495)
at org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:470)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
2 个解决方案
#1
1、适当的增大hbase.regionserver.lease.period参数的值,默认是1分钟
2、增大regionserver的cache大小试试
2、增大regionserver的cache大小试试
#2
你这个是单机下的吧???
#1
1、适当的增大hbase.regionserver.lease.period参数的值,默认是1分钟
2、增大regionserver的cache大小试试
2、增大regionserver的cache大小试试
#2
你这个是单机下的吧???