1 .问题 

  1.启动 zookeeper 后 用指令:  telnet 127.0.0.1 2181 连接 提示输入指令 :stat 后报错,然后关闭连接

    

2.问题解决:

  修改启动指令 zkServer.sh ,往里面添加 :ZOOMAIN="-Dzookeeper.4lw.commands.whitelist=* ${ZOOMAIN}"

  步骤 :

    1.cd  apache-zookeeper-3.5.5-bin 

    2. vim vim  bin/zkServer.sh

    3.修改 ,添加:ZOOMAIN="-Dzookeeper.4lw.commands.whitelist=* ${ZOOMAIN}" ,保存退出

    

      JMXLOG4J=true
    fi
    echo "ZooKeeper remote JMX Port set to $JMXPORT" >&2
    echo "ZooKeeper remote JMX authenticate set to $JMXAUTH" >&2
    echo "ZooKeeper remote JMX ssl set to $JMXSSL" >&2
    echo "ZooKeeper remote JMX log4j set to $JMXLOG4J" >&2
    ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT -Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL -Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
  fi
else
    echo "JMX disabled by user request" >&2
    ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
fi
ZOOMAIN="-Dzookeeper.4lw.commands.whitelist=* ${ZOOMAIN}"
if [ "x$SERVER_JVMFLAGS" != "x" ]
then
    JVMFLAGS="$SERVER_JVMFLAGS $JVMFLAGS"
fi

if [ "x$2" != "x" ]
then
    ZOOCFG="$ZOOCFGDIR/$2"
fi

  4.重启: bin/zkServer.sh start

 

参考文章 :https://blog.csdn.net/x763795151/article/details/80599498

      

 

posted on 2019-08-19 15:39  JonRain0625  阅读(6866)  评论(0编辑  收藏  举报