配置
在./bin/zkServer.sh中添加开启jmx的命令如下:
if [ "x$JMXLOCALONLY" = "x" ]
then
JMXLOCALONLY=false
fi
if [ "x$JMXDISABLE" = "x" ]
then
echo "JMX enabled by default" >&2
# for some reason these two options are necessary on jdk6 on Ubuntu
# accord to the docs they are not necessary, but otw jconsole cannot
# do a local attach
ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10880 -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=hzadg-mammut-platform8.server.163.org -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremo
te.local.only=$JMXLOCALONLY org.apache.zookeeper.server.quorum.QuorumPeerMain"
else
echo "JMX disabled by user request" >&2
ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
fi
基于jconsole监控
参考:
* https://stackoverflow.com/questions/834581/remote-jmx-connection
本文介绍如何在ZooKeeper的zkServer.sh脚本中配置JMX参数以启用远程监控功能。通过设置特定的JMX选项,可以使用jconsole等工具进行远程监控,这对于维护和管理ZooKeeper集群非常有用。

594

被折叠的 条评论
为什么被折叠?



