A.gmetad需要先安裝RRDTool,默認的安裝路徑:/usr/local/rrdtool- tar zxvf rrdtool-*.tar.gz cd rrdtool-* ./configure --prefix=/usr #使用/usr會減少很多麻煩,頭文件會放到/usr/include,庫文件放到/usr/lib make; make install B. gmetad的安裝(目前版本是3.0.3) gmetad不是默認安裝的,安裝時需要加參數 --with-gmetad 。即rrdtool庫及其頭文件必須存在,默認的路徑是/usr/include/rrd.h和 /usr/lib/librrd.a,如果在安裝rrdtool時安在了不同的路徑下,這裡需要指明它們的路徑。 tar –zxvf ganglia-3.0.3.tar.gz cd ganglia-* ./configure --prefix=/usr/local/ganglia CFLAGS="-I/rrd/header/path" \ CPPFLAGS="- I/rrd/header/path" LDFLAGS="-L/rrd/library/path" --with-gmetad make; make install 將gmetad.init文件拷貝到 /etc/init.d/: cd ganglia-3.0.3/gmetad cp gmetad.init /etc/init.d/gmetad 將配置文件拷貝到/etc目錄下: cp gmetad.conf /etc/gmetad.conf chkconfig gmetad on chkconfig --list gmetad GMETAD 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Whe using gmetad make sure you have directory /var/lib/ganglia/rrds owned by "nobody" For more info look at README 啟動gmetad: service gmetad start Starting GANGLIA gmetad: [ OK ] 驗證gmetad正常工作:telnet localhost 8651 就可以得到監控的各個主機的狀態。 gmetad.conf的配置 # data_source "another source" 1.3.4.7:8655 1.3.4.8 data_source "SERVER" 10 node1 node2 data_source是最重要的參量,在GMOND的Cluser name配置必須與data_source的相同,這個參量被設置為群的名字,被監測以便能監測那群狀態。如果有二個或更多監測對象,當有一對象不能被監測,將讀取data_source 配置的下一個對象
2) client端安裝和配置 安裝ganglia: tar zxvf ganglia-3.0.3.tar.gz cd ganglia-3.0.3 ./configure --prefix=/usr/local/ganglia make; make install cd ganglia-3.0.3/gmond gmond –t > /etc/gmond.conf cp gmond.init /etc/init.d/gmond chkconfig gmond on chkconfig --list gmond gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off service gmond start Starting GANGLIA gmond: [ OK ] 驗證gmond正常工作:telnet localhost 8649 就可以獲取機群內運行gmond的主機的信息 配置gmond.conf: /etc/gmond.conf: globals { setuid = no user = nobody cleanup_threshold = 300 /*secs */ } 修改監控組名稱 name = 「SERVER」 配置完成後重新啟動gmond.
3)安裝web前端 cp -a ganglia-3.0.3/web /var/www/html/ganglia 確定web server支持PHP4 對apache來說,php模塊mod_php的狀態應該是enabled,貌似默認就是的^_^ 配製文件是/var/www/html/ganglia/conf.php