我在Docker中运行了HBase。我可以使用阴影客户端连接并执行getClusterMetrics()并获取表描述符。但是,当我尝试使用get或scan从表中读取数据时,出现此异常
543935 [ReadOnlyZKClient-hbase:2181@0x687080dc-SendThread(kubernetes.docker.internal:2181)] DEBUG org.apache.hadoop.hbase.shaded.org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x16ed32515ad001d, packet:: clientPath:/hbase serverPath:/hbase finished:false header:: 259,8 replyHeader:: 259,135,0 request:: '/hbase,F response:: v{'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'master-maintenance,'online-snapshot,'master,'switch,'running,'draining,'namespace,'hbaseid,'table}
543935 [ReadOnlyZKClient-hbase:2181@0x687080dc-SendThread(kubernetes.docker.internal:2181)] DEBUG org.apache.hadoop.hbase.shaded.org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x16ed32515ad001d after 2ms
543938 [ReadOnlyZKClient-hbase:2181@0x687080dc-SendThread(kubernetes.docker.internal:2181)] DEBUG org.apache.hadoop.hbase.shaded.org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x16ed32515ad001d, packet:: clientPath:/hbase/meta-region-server serverPath:/hbase/meta-region-server finished:false header:: 260,4 replyHeader:: 260,135,0 request:: '/hbase/meta-region-server,F response:: #ffffffff000146d61737465723a3136303030ffffffe9ffffffa25fffffffe1135effffffa8ffffffe450425546a11a5686261736510ffffff947d18ffffffb9ffffffc6ffffff94ffffff99ffffffed2d100183,s{34,35,1575500467238,1575500468433,1,0,0,0,52,0,34}
543944 [hconnection-0x23986957-metaLookup-shared--pool5-t11] DEBUG org.apache.hadoop.hbase.client.RpcRetryingCallerImpl - Call exception, tries=8, retries=16, started=18351 ms ago, cancelled=false, msg=Call to hbase/127.0.0.1:16020 failed on local exception: org.apache.hadoop.hbase.exceptions.ConnectionClosedException: Connection closed, details=row 'janusgraph,configuration,99999999999999' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=hbase,16020,1575500456761, seqNum=-1, see https://s.apache.org/timeout, exception=org.apache.hadoop.hbase.exceptions.ConnectionClosedException: Call to hbase/127.0.0.1:16020 failed on local exception: org.apache.hadoop.hbase.exceptions.ConnectionClosedException: Connection closed
主日志包含以下警告:(编辑:这些似乎无关紧要)
2019-12-05 00:47:26,780 WARN [qtp1634411546-76] http.HttpParser: Illegal character 0x0 in state=METHOD for buffer HeapByteBuffer@253d3e6[p=5,l=348,c=8192,r=343]={HBas\x00<<<P\x00\x00\x00\xF8\n\n\n\x08nialeksi...\x00\x10\xFf\xFf\xFf\xFf\xFf\xFf\xFf\xFf0\x018\x01>>>kie: JSESSIONID=1...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2019-12-05 00:47:26,780 WARN [qtp1634411546-76] http.HttpParser: bad HTTP parsed: 400 Illegal character 0x0 for HttpChannelOverHttp@1cee436c{r=0,c=false,a=IDLE,uri=null}
HBase版本是2.2.2,并且Shaded客户端也是2.2.2。
编辑:在HBase容器中执行客户端程序工作正常,这意味着这是某种连接问题。在我的etc / hosts内部,我确实将hbase和hadoop都指向了127.0.0.1
127.0.0.1无法被其他机器识别。域名可以解决这个问题。