美文网首页安装部署
Zookeeper伪分布式端口冲突解决方案

Zookeeper伪分布式端口冲突解决方案

作者: 明训 | 来源:发表于2021-03-03 21:56 被阅读0次

    背景说明

    zookeeper单机启动两个进程出现了端口冲突,报错信息如下

    [root@ljhan2 bin]# cat zookeeper.out
    Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9999; nested exception is:         java.net.BindException: Address already in use (Bind failed)
    [root@ljhan2 bin]#
    

    解决方案

    查看启动脚本

     33 if [ "x$JMXDISABLE" = "x" ]
     34 then
     35     echo "JMX enabled by default" >&2
     36     # for some reason these two options are necessary on jdk6 on Ubuntu
     37     #   accord to the docs they are not necessary, but otw jconsole cannot
     38     #   do a local attach
     39     #ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY org.apache.zook    eeper.server.quorum.QuorumPeerMain"
     40     ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.    ssl=false  -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY     org.apache.zookeeper.server.quorum.QuorumPeerMain"
     41 else
     42     echo "JMX disabled by user request" >&2
     43     ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
     44 fi
    

    修改其中端口号99998888即可,再次启动发现问题解决。

    相关文章

      网友评论

        本文标题:Zookeeper伪分布式端口冲突解决方案

        本文链接:https://www.haomeiwen.com/subject/tkicqltx.html