您好,登錄后才能下訂單哦!
1、安裝ganglia參考之前的一篇博客(以下示例使用ganglia組播方式,單播方式大家自己嘗試)
http://chengyanbin.blog.51cto.com/3900113/1591373
2、安裝jmxtrans
http://chengyanbin.blog.51cto.com/3900113/1654754
3、安裝storm
http://chengyanbin.blog.51cto.com/3900113/1654757
4、修改storm配置文件storm..yaml
###nimbus config nimbus.childopts: "-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=12345 -Xmx1024m" ###supervisor config supervisor.childopts: "-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=12346 -Xmx256m"
5、為jmxtrans增加兩個json文件
分別獲取nimbus和supervisor節點的jvm信息,以下文件僅列舉了部分參數,如果有需要可以增加queries中的數據,以監控更多的參數,具體的MBean的參數,可以通過jconsole來查看
nimbus.json
{ "servers": [ { "host": "master", "port": "12345", "queries": [ { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "nimbus", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:type=Memory", "resultAlias": "nimbus.heap", "attr": [ "ObjectPendingFinalizationCount" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "nimbus", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:name=Copy,type=GarbageCollector", "resultAlias": "nimbus.gc", "attr": [ "CollectionCount", "CollectionTime" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "nimbus", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:name=Code Cache,type=MemoryPool", "resultAlias": "nimbus.threads", "attr": [ "CollectionUsageThreshold", "CollectionUsageThresholdCount", "UsageThreshold", "UsageThresholdCount" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "nimbus", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:type=Runtime", "resultAlias": "nimbus.runtime", "attr": [ "StartTime", "Uptime" ] } ], "numQueryThreads": 2 } ] }
supervisor.json
{ "servers": [ { "host": "node1", "port": "12346", "queries": [ { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "supervisor", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:type=Memory", "resultAlias": "supervisor.heap", "attr": [ "ObjectPendingFinalizationCount" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "supervisor", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:name=Copy,type=GarbageCollector", "resultAlias": "supervisor.gc", "attr": [ "CollectionCount", "CollectionTime" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "supervisor", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:name=Code Cache,type=MemoryPool", "resultAlias": "supervisor.threads", "attr": [ "CollectionUsageThreshold", "CollectionUsageThresholdCount", "UsageThreshold", "UsageThresholdCount" ] }, { "outputWriters": [ { "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter", "settings": { "groupName": "supervisor", "host": "239.2.11.71", "port": "8649" } } ], "obj": "java.lang:type=Runtime", "resultAlias": "supervisor.runtime", "attr": [ "StartTime", "Uptime" ] } ], "numQueryThreads": 2 } ] }
兩個json文件一定要注意host是主機名,如果寫ip的話,在ganglia里同一個節點會有兩個顯示,看著有點別扭,大家都統一使用hostname就好.ganglia的gmnod和gmetad不需要重啟,用自動收集。
說明:
修改json文件需要重新啟動jmxtrans,查看jmxtrans日志/var/log/jmxtrans/jmxtrans.log.
service jmxtrans restart
下面來張ganglia的主界面,監控兩個節點
上圖顯示不出來監控指標,就放下面來了,可以看到supervisor的監控數據已經收集到ganglia里了。
下圖搞了master節點的頁面,可以看到nimbus group的監控數據已經顯示,node1節點的supervisor group懶得上圖了,大家可以明白了,不明白的去面壁去
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。