警告服务器为空的会话0x0,出现意外错误,正在关闭套接字连接并尝试重新连接

7cjasjjr  于 2021-06-26  发布在  Mesos
关注(0)|答案(2)|浏览(567)

我有两个节点,每个节点上都安装了docker和mesos、marathon和zookeeper。这是我在主节点上的docker compose文件:

version: '3.7'
 services:
  zookeeper:
   image: ubuntu_mesos_home_marzieh
   command: /home/zookeeper-3.4.8/bin/zkServer.sh restart
  environment:
    ZOOKEEPER_SERVER_ID: 1
    ZOOKEEPER_CLIENT_PORT: 2190
    ZOOKEEPER_TICK_TIME: 2000
    ZOOKEEPER_INIT_LIMIT: 10
    ZOOKEEPER_SYNC_LIMIT: 5
    ZOOKEEPER_SERVERS: 150.20.11.133:2888:3888;150.20.11.136:2888:3888
  network_mode: host
  expose:
    - 2190
    - 2888
    - 3888
  ports:
    - 2190:2190
    - 2888:2888
    - 3888:3888

 master-mesos:
  image: ubuntu_mesos_home_marzieh
  command: bash -c "sleep 30; /home/mesos-1.7.0/build/bin/mesos- 
    master.sh --ip=150.20.11.133 --work_dir=/var/run/mesos 
    --hostname=150.20.11.133" 
  privileged: true
  restart: always
  network_mode: host
  depends_on:
    - zookeeper
  environment:
    - LIBPROCESS_IP=150.20.11.133
    - MESOS_HOSTNAME="150.20.11.133"
    - MESOS_QUORUM=1
    - MESOS_LOG_DIR=/var/log/mesos
    - MESOS_WORK_DIR=/var/run/mesos
  expose:
    - 5050
    - 4040
    - 7077
    - 8080
  ports:
    - 5050:5050
    - 4040:4040
    - 7077:7077
    - 8080:8080

 marathon:
  image: ubuntu_mesos_home_marzieh
  command: bash -c "sleep 60; /usr/share/marathon/bin/marathon"
  privileged: true
  network_mode: host
  depends_on:
    - zookeeper
    - master-mesos
  environment:
    - HOSTNAME="150.20.11.133"
    - MARATHON_ZK=zk://150.20.11.133:2190/marathon
    - MARATHON_MASTER=zk://150.20.11.133:2190/mesos
    - MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so
    - MARATHON_HTTP_PORT=8080
  expose:
    - 8080
    - 2190
  ports:
    - 8080:8080
    - 2190:2190

这是docker compose for slave node:

version: '3.7'
  services:
   zookeeper:
     image: ubuntu_mesos_home_marzieh
     command: /home/zookeeper-3.4.8/bin/zkServer.sh start
     environment:
       ZOOKEEPER_SERVER_ID: 2
       ZOOKEEPER_CLIENT_PORT: 2190
       ZOOKEEPER_TICK_TIME: 2000
       ZOOKEEPER_INIT_LIMIT: 10
       ZOOKEEPER_SYNC_LIMIT: 5
       ZOOKEEPER_SERVERS: 
       150.20.11.133:2888:3888;150.20.11.136:2888:3888
    network_mode: host
    expose:
     - 2190
     - 2888
     - 3888
    ports:
     - 2190:2190
     - 2888:2888
     - 3888:3888

  slave-mesos:
     image: ubuntu_mesos_home_marzieh
     command: bash -c "sleep 40; /home/mesos-1.7.0/build/bin/mesos- 
     slave.sh --master=150.20.11.133:5050 --work_dir=/var/run/mesos
     --systemd_enable_support=false"
     privileged: true
     restart: always
     privileged: true
     network_mode: host
     depends_on:
      - zookeeper
     environment:
       - MESOS_RESOURCES=ports(*):[11000-11999]
       - LIBPROCESS_IP=150.20.11.136
       - MESOS_HOSTNAME="150.20.11.136"
       - MESOS_EXECUTOR_REGISTRATION_TIMEOUT=5mins 
       - MESOS_LOG_DIR=/var/log/mesos
       - MESOS_WORK_DIR=/var/run/mesos
       - MESOS_LOGGING_LEVEL=INFO
     expose:
       - 5051
     ports:
       - 5051:5051

   marathon:
    image: ubuntu_mesos_home_marzieh
    command: bash -c "sleep 60; /usr/share/marathon/bin/marathon"
    privileged: true
    network_mode: host
    depends_on:
      - zookeeper
      - slave-mesos
    environment:
      - MARATHON_ZK=zk://150.20.11.133:2190/marathon
      - MARATHON_MASTER=zk://150.20.11.133:2190/mesos
      - MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so
      - MARATHON_HTTP_PORT=8080
    expose:
      - 8080
      - 2190
    ports:
      - 8080:8080
      - 2190:2190

我在“zoo.cfg”上配置了zookeeper,并为每个节点创建了“myid”文件。我还配置了中跑和马拉松。但是,当我在主节点(150.20.11.133)上运行docker compose时,出现以下错误:
marathon| java.net.connectexception:连接被拒绝marathon| at sun.nio.ch.socketchannelimpl.checkconnect(本机方法)
马拉松比赛|在sun.nio.ch.socketchannelimpl.finishconnect(socketchannelimpl。java:717)marathon|位于org.apache.zookeeper.clientcnxnsocketnio.dotransport(clientcnxnsocketnio。java:361)
marathon|在org.apache.zookeeper.clientcnxn$sendthread.run(clientcnxn。java:1144)marathon|[2019-02-16 13:38:14087]信息打开到服务器的套接字连接172.28.10.133/172.28.10.133:2190。不会尝试使用sasl(未知错误)(org.apache.zookeeper.c)进行身份验证lientcnxn:main-sendthread(172.28.10.133:2190))
marathon|[2019-02-16 13:38:14087]警告会话0x0服务器为空,出现意外错误,正在关闭套接字连接并尝试重新连接(org.apache.zookeeper.c)lientcnxn:main-sendthread(172.28.10.133:2190))
marathon| java.net.connectexception:连接被拒绝marathon| at sun.nio.ch.socketchannelimpl.checkconnect(本机方法)
马拉松比赛|在sun.nio.ch.socketchannelimpl.finishconnect(socketchannelimpl。java:717)
marathon|位于org.apache.zookeeper.clientcnxnsocketnio.dotransport(clientcnxnsocketnio。java:361)
marathon|在org.apache.zookeeper.clientcnxn$sendthread.run(clientcnxn。java:1144)marathon|[2019-02-16 13:38:14173]连接到zk失败。马拉松马上就要结束了(mesophere.marathon.core.storage.store.impl.zk.richcurator目录framework:main)
我不知道会发生什么。我试图用ufw或禁用防火墙打开每个端口,但错误并没有消失。你能告诉我docker compose文件有什么问题吗?
任何帮助都将不胜感激。
谢谢。

0sgqnhkj

0sgqnhkj1#

我刚重启了“Zookeeper”,一切都很顺利。

./ZOOKEEPER_HOME/bin/zkServer.sh restart
6kkfgxo0

6kkfgxo02#

“server null”表示在运行zk cli时没有收到服务器参数的值。
查看是否可以通过命令行来覆盖配置文件中指定的zookeeper服务器和端口。
./zkcli.sh-服务器hostname:port

相关问题