生活随笔
收集整理的這篇文章主要介紹了
hbase 租约超时及rpc超时出现的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
隨著數據量的增大,HIVE查詢HBase的時候又出現了scan數據緩慢的問題,在HBase regionserver的log中出現了如下錯誤:
?
[plain]?view plaincopy
org.apache.hadoop.hbase.regionserver.LeaseException:?lease?'-8841369309248784313'?does?not?exist?? ????????at?org.apache.hadoop.hbase.regionserver.Leases.removeLease(Leases.java:230)?? ????????at?org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer.java:1847)?? ????????at?sun.reflect.GeneratedMethodAccessor11.invoke(Unknown?Source)?? ????????at?sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)?? ????????at?java.lang.reflect.Method.invoke(Method.java:597)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)?? 2012-05-28?13:36:21,181?ERROR?org.apache.hadoop.hbase.regionserver.HRegionServer:?? org.apache.hadoop.hbase.regionserver.LeaseException:?lease?'-20083236624351071'?does?not?exist?? ????????at?org.apache.hadoop.hbase.regionserver.Leases.removeLease(Leases.java:230)?? ????????at?org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer.java:1847)?? ????????at?sun.reflect.GeneratedMethodAccessor11.invoke(Unknown?Source)?? ????????at?sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)?? ????????at?java.lang.reflect.Method.invoke(Method.java:597)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)?? 2012-05-28?13:36:31,008?INFO?org.apache.hadoop.hbase.regionserver.HRegionServer:?Scanner?-3191709564730585697?lease?expired?? 2012-05-28?13:36:53,643?INFO?org.apache.hadoop.hbase.regionserver.HRegionServer:?Scanner?-8491627947231463698?lease?expired?? 2012-05-28?13:36:54,842?ERROR?org.apache.hadoop.hbase.regionserver.HRegionServer:?? org.apache.hadoop.hbase.regionserver.LeaseException:?lease?'-1061333795005896429'?does?not?exist?? ????????at?org.apache.hadoop.hbase.regionserver.Leases.removeLease(Leases.java:230)?? ????????at?org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer.java:1847)?? ????????at?sun.reflect.GeneratedMethodAccessor11.invoke(Unknown?Source)?? ????????at?sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)?? ????????at?java.lang.reflect.Method.invoke(Method.java:597)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)?? 2012-05-28?13:36:54,952?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?Responder,?call?next(-8841369309248784313,?5000)?from?10.64.49.25:58991:?output?error?? 2012-05-28?13:36:54,952?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?handler?5?on?60020?caught:?java.nio.channels.ClosedChannelException?? ????????at?sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)?? ????????at?sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelIO(HBaseServer.java:1389)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelWrite(HBaseServer.java:1341)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.processResponse(HBaseServer.java:727)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.doRespond(HBaseServer.java:792)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1083)?? ?? 2012-05-28?13:36:58,234?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?Responder,?call?next(-1061333795005896429,?5000)?from?10.64.49.22:5606:?output?error?? 2012-05-28?13:36:58,234?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?handler?6?on?60020?caught:?java.nio.channels.ClosedChannelException?? ????????at?sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)?? ????????at?sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelIO(HBaseServer.java:1389)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelWrite(HBaseServer.java:1341)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.processResponse(HBaseServer.java:727)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.doRespond(HBaseServer.java:792)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1083)?? ?? 2012-05-28?13:37:12,103?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?Responder,?call?next(-20083236624351071,?5000)?from?10.64.49.25:59004:?output?error?? 2012-05-28?13:37:12,103?WARN?org.apache.hadoop.ipc.HBaseServer:?IPC?Server?handler?1?on?60020?caught:?java.nio.channels.ClosedChannelException?? ????????at?sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)?? ????????at?sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelIO(HBaseServer.java:1389)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer.channelWrite(HBaseServer.java:1341)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.processResponse(HBaseServer.java:727)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Responder.doRespond(HBaseServer.java:792)?? ????????at?org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1083)??
說是租約(Lease)過期或租約不存在,所謂租約,是指hbase client端每次和regionserver交互的時候,都會在服務器端生成一個租約(Lease),租約的有效期由參數hbase.regionserver.lease.period確定。
?
客戶端去regionserver取數據的時候,hbase中存得數據量很大并且很多region的時候的,客戶端請求的region不在內存中,或是沒有被cache住,需要從磁盤中加載,如果這時候加載需要的時間超過hbase.regionserver.lease.period所配置的時間,并且客戶端沒有和regionserver報告其還活著,那么regionserver就會認為本次租約已經過期,并從LeaseQueue中從刪除掉本次租約,當regionserver加載完成后,拿已經被刪除的租約再去取數據的時候,就會出現如上的錯誤現象。
?
其實在做hbase批量數據刪除的時候就出現過這個問題,然后也修改了hbase.regionserver.lease.period參數(默認為60000,一分鐘),但是在做scan的時候還是出現了上面的問題。問題出在哪呢?
?
后來發現是hbase.rpc.timeout的問題,出現租約過期的時候,可以根據需求適當的增加租約的有效時間,但卻忽略了RPC超時的問題,所以在增大hbase.regionserver.lease.period的時候應該同時增大hbase.rpc.timeout,同時hbase.rpc.timeout應該等于或大于hbase.regionserver.lease.period。
總結
以上是生活随笔為你收集整理的hbase 租约超时及rpc超时出现的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。