2017年大數據年終盤點:開源工具、MySQL和Python是最大贏家
814
2025-04-03
文章目錄
Pre
JMX配置
OP
開啟 JMX
JConsle 通過 JMX訪問遠端 ZooKeeper服務
Pre
為了應用服務能夠持續穩定地對外提供服務,除了在部署的時候盡量采用分布式、集群服務等方式提高 ZooKeeper 服務的可靠性外,在服務上線運行的時候,我們還可以通過對 ZooKeeper 服務的運行狀態進行監控,如運行 ZooKeeper 服務的生產服務器的 CPU 、內存、磁盤等使用情況來達到目的。在系統性能達到瓶頸的時候,可以增加服務器資源,以保證服務的穩定性。
JMX配置
主要是 輸入 JMX 服務的端口號并禁止身份認證等配置
-Djava.rmi.server.hostname=服務器的IP地址或者域名 -Dcom.sun.management.jmxremote.port=端口號 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
連不上的話,別忘了檢查
-Djava.rmi.server.hostname
java.rmi.server.hostname
The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. The default value of this property is the IP address of the local host, in “dotted-quad” format.
By default, the remote stubs for locally created remote objects that are sent to client contains the IP address of the local host in dotted-quad format. For remote stubs to be associated with a specific interface address, the java.rmi.server.hostname system property must be set to IP address of that interface.
OP
開啟 JMX
查看zk的啟動腳本 zkServer.sh
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"
可以看到,是支持jmx監控的,只是這些參數木有值, 加上唄
主要是 輸入 JMX 服務的端口號并禁止身份認證等配置
通過-Djava.rmi.server.hostname=192.168.126.136 jmx選項明確指定jmx server遠程調用服務關聯的ip地址為10.242.93.40
別忘了重啟ZK哈
JConsle 通過 JMX訪問遠端 ZooKeeper服務
JConsole 是 JDK 自帶的工具,用來監控程序運行的狀態信息。
之所以能夠通過 JConsole 連接 ZooKeeper 服務進行監控,是因為 ZooKeeper 支持 JMX(Java Management Extensions),即 Java 管理擴展,它是一個為應用程序、設備、系統等植入管理功能的框架。
JMX 可以跨越一系列異構操作系統平臺、系統體系結構和網絡傳輸協議,靈活地開發無縫集成的系統、網絡和服務管理應用。我們可以通過 JMX 來訪問和管理 ZooKeeper 服務集群。
完了 ,走了
Apache ZooKeeper
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。