Ganglia安裝
1 主節點配置
1.1 安裝ganglia-monitor ganglia-webfrontend gmetad,同時會將依賴的軟件安裝,包括apache和php
sudo apt-get install ganglia-monitor ganglia-webfrontend gmetad
如果自己手動安裝依賴的軟件,可以執行如下命令
sudo apt-get install rrdtool apache2 php7
1.2 複製 Ganglia webfrontend Apache 配置
sudo cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf
1.3 編輯 Ganglia 元守護程序的配置文件
sudo nano /etc/ganglia/gmetad.conf
更改如下位置:
data_source "my cluster" localhost
修改爲:
data_source "my cluster" heron01,heron02,heron03,heron04
同時,可設置多個data_source,建議將不同功能的機器放到不同的分組中。。。。例如
data_source "master" master:8649
data_source "worker" slave1:8650, slave2:8650
這裏,不同分組要用不同的端口號!!
1.4 編輯主節點的配置文件
sudo gedit /etc/ganglia/gmond.conf
做下面的變化:
cluster {
name = "my cluster"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
/* Feel free to specify as many udp_send_channels as you like. Gmond
used to only support having a single channel */
udp_send_channel {
mcast_join = 239.2.11.71
port = 8649
ttl = 1
}
/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
mcast_join = 239.2.11.71
port = 8649
bind = 239.2.11.71
}
只需要修改cluster{
}
其他的組播不需要修改,否則會造成失敗
其中data_source分組與端口號要保持一直
保存並關閉文件。
需要重啓服務:
sudo /etc/init.d/ganglia-monitor start
sudo /etc/init.d/gmetad start
sudo /etc/init.d/apache2 restart
2 客戶機配置
2.1 安裝以下所有服務器要監視客戶端包
sudo apt-get install ganglia-monitor
2.2 編輯客戶節點的配置文件gmond.conf,這裏和主節點的一致就行,但是如果有多個分組,那個分組名要和端口號保持一致
2.3 重啓 ganglia monitor 服務
sudo /etc/init.d/ganglia-monitor restart
3 網頁端查看
http://heron03/ganglia/
參考資料:https://www.cnblogs.com/liuchangchun/p/4576435.html