hbase zookeeper连接错误

h7wcgrx3  于 2021-06-08  发布在  Hbase
关注(0)|答案(1)|浏览(554)

我正在docker容器中运行hbase。当它使用docker compose文件启动时,我看到以下错误:
警告[nioservercxn。factory:0.0.0.0/0.0.0.0:2181]server.nioservercnxn:捕获到流结束异常
endofstreamexception:无法从客户端sessionid 0x16205128eac02db读取其他数据,可能客户端已关闭套接字
在org.apache.zookeeper.server.nioservercnxn.doio(nioservercnxn。java:228)
位于org.apache.zookeeper.server.nioservercnxnfactory.run(nioservercnxnfactory)。java:208)
在java.lang.thread.run(线程。java:748)2018-03-08 12:59:45737信息[nioservercxn。factory:0.0.0.0/0.0.0.0:2181]server.nioservercnxn:客户端的已关闭套接字连接/172.18.0.2:45372,其会话ID为0x16205128eac02db
当我运行mapreduce从hbase获取数据时,我还看到了以下内容:

Disconnecting client for session: 0x16205128eac00dc org.apache.zookeeper.ClientCnxn.disconnect(ClientCnxn.java:1290) 
An exception was thrown while closing send thread for session 0x16205128eac00dc : Unable to read additional data from server sessionid 0x16205128eac00dc, likely server has closed socket org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1086)

我有什么办法可以解决这个问题吗?我的zoo.cfg文件如下所示:

clientPort=2181
clientPortAddress=hbase-docker
server.1=hbase-docker:2181
maxClientCnxns=200

docker compose文件如下所示:

hbase-docker:
  hostname: "hbase-docker"
  container_name: "hbase-docker"
  build:
    dockerfile: "Dockerfile-5.6"
    context: "./hbase-docker/"
  volumes:
  - "./hbase-docker/data:/data"
  ports:
  - "2181:2181"

docker容器中的hbase版本为:1.2.4
zookeeper版本:3.4.6-1569965
docker版本:17.12.1-ce,内部版本7390fc6
docker compose版本:1.16.1,内部版本6d1ac21
操作系统版本:ubuntu 16.04.4 lts(xenial)
dockerfile如下所示:


# HBase in Docker

# 

# Version 0.3

# http://docs.docker.io/en/latest/use/builder/

FROM ubuntu:xenial

COPY *.sh /build/

ENV HBASE_VERSION 1.2.4

RUN mkdir -p /var/zookeeper && \
    /build/prepare-hbase.sh && \
    cd /opt/hbase && /build/build-hbase.sh \
    cd / && /build/cleanup-hbase.sh 

VOLUME /data

ADD ./hbase-site.xml /opt/hbase/conf/hbase-site.xml

ADD ./zoo.cfg /opt/hbase/conf/zoo.cfg

ADD ./replace-hostname /opt/replace-hostname

ADD ./hbase-server /opt/hbase-server

# REST API

EXPOSE 8080

# REST Web UI at :8085/rest.jsp

EXPOSE 8085

# Thrift API

EXPOSE 9090

# Thrift Web UI at :9095/thrift.jsp

EXPOSE 9095

# HBase's Embedded zookeeper cluster

EXPOSE 2181

# HBase Master web UI at :16010/master-status;  ZK at :16010/zk.jsp

EXPOSE 16010

CMD ["/opt/hbase-server"]
kb5ga3dv

kb5ga3dv1#

看起来zoo.cfg文件中缺少datadir。 dataDir = /path/to/zookeeper/data 请确保指定的目录已存在,或者需要添加dockerfile来创建此目录,然后用其他名称重建映像。

相关问题