CentOS安裝配置ganglia 1. 下載ganglia源碼包並解壓[python] wget http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.1.1%20%28Wien%29/ganglia-3.1.1.tar.gz/download?use_mirror=jaist tar -zxvf ganglia-3.1.1.tar.gz 2. 安裝ganglia(安裝gmetad和gmond) cd ganglia-3.1.1 在需要web frontend的機器上安裝gmetad,configure參數為: [python] ./configure --with-gmetad --enable-gexec gmetad依賴g++、rrdtool-devel、apr-devel、libconfuse、libexpat包,先安裝上述依賴包: [python] yum install gcc-c++ yum install rrdtool-devel yum install apr-devel yum安裝libconfuse、libexpat失敗後解決方案: 安裝libconfuse: [python] wget http://download.savannah.gnu.org/releases/confuse/confuse-2.7.tar.gz tar zxvf confuse-2.6.tar.gz ./configure CFLAGS=-fPIC --disable-nls--prefix=/usr/local/confuse make make install 64bit機器需要拷貝動態連結程式庫: [python] mkdir -p /usr/local/confuse/lib64 cp -a -f /usr/local/confuse/lib/* /usr/local/confuse/lib64/ 安裝libexpat: [python] wget http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz?use_mirror=cdnetworks-kr-2 tar zxvf expat-2.0.1.tar.gz ./configure --prefix=/usr/local/expat make make install 64bit機器需要拷貝動態連結程式庫: [python] mkdir /usr/local/expat/lib64 cp -a /usr/local/expat/lib/* /usr/local/expat/lib64/ 安裝完依賴包後,執行./configure命令: [python] ./configure --with-gmetad --enable-gexec--with-libconfuse=/usr/local/confuse --with-libexpat=/usr/local/expat 出現的介面時則ganglia安裝成功: 按照提示make ganglia: [python] make make install 在make的過程中可能會出現類似“mod_python.c:48:20: error: Python.h: No such file or directory”的錯誤,此時需要安裝python: [python] yum install python-devel 安裝python完成後再進行make即可 3. 伺服器端配置gmetad 建立rrdtool資料目錄: [python] mkdir -p /var/lib/ganglia/rrds mkdir -p /var/lib/ganglia/dwoo chown -R apache:apache /var/lib/ganglia 修改/etc/ganglia/gmetad.conf檔案: [python] vim /etc/ganglia/gmetad.conf data_source "suc" localhost setuid_username "apache" 注意:若設定檔中data_source和setuid_username被“#”注釋需要去掉注釋 [python] cp gmetad/gmetad.init /etc/init.d/gmetad mkdir /etc/ganglia cp gmetad/gmetad.conf /etc/ganglia/ cp -f gmetad /usr/sbin/gmetad chkconfig --add gmetad 啟動gmetad服務: [python] service gmetad start 若顯示“Starting GANGLIA gmetad: [確定]”則表示gmetad運行正常 通過telnet localhost 8651驗證gmetad是否正常 4. 本機用戶端配置gmond [python] cp -f gmond/gmond.init /etc/init.d/gmond cp -f gmond /usr/sbin/gmond chkconfig --add gmond gmond --default_config > /etc/ganglia/gmond.conf 修改/etc/ganglia/gmond.conf設定檔: [python] cluster { name="suc" //和gmetad.conf設定檔對應 owner="apache" //和gmetad.conf設定檔對應 latlong="unspecified" url="unspecified" } 啟動gmond服務: [python] service gmond start 若顯示“Starting GANGLIA gmond: [確定]”則表示gmond運行正常 通過telnet localhost 8649驗證gmond是否正常 5. 伺服器端配置web [python] yum install php-common php-cli php php-gd httpd mkdir /var/www/html/ganglia cp -a -f web/* /var/www/html/ganglia 重啟http服務: [python] service httpd restart 6. 開啟瀏覽器查看ganlia web介面資訊 [python] http://localhost:/ganglia 顯示則表示ganglia完整安裝成功: 實驗環境:CentOS6.0 x86_64 [python] <pre name="code" class="cpp"><pre name="code" class="cpp"><p></p></pre> <pre></pre> <pre></pre> <pre></pre> <pre></pre> </pre>