依賴資源:http://oss.oetiker.ch/rrdtool/pub/libs/
參考:
http://thinkingquest.blog.163.com/blog/static/203677175201261310456643/
http://blog.csdn.net/osoon/article/details/5526455
http://blog.csdn.net/dumeifang/article/details/2963223
http://www.lingzhong.cn/tech/18834.htm
一、安裝pixman
pixman-0.10.0.tar.gz
./configure
make
make install
二、安裝cairo
cairo-1.6.4.tar.gz
./configure
configure: error: pixman >= 0.10.0 is required
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/lib/pkgconfig
./configure
make
make install
三、安裝pango
pango-1.17.5.tar.gz
./configure
make
make install
四、安裝rrdtool
rrdtool-1.4.8.tar.gz
./configure --prefix=/usr/local/rrdtool-1.4.8 --datarootdir=/home/rrdtool
make
make install
五、安裝ganglia
ganglia-3.6.0.tar.gz
/usr/bin/ld: cannot find -lrrd
find / -name librrd.so
/usr/local/rrdtool-1.4.8/lib/librrd.so
cd /usr/lib
ln -s /usr/local/rrdtool-1.4.8/lib/librrd.so librrd.so
gcc -lrrd --verbose
./configure --prefix=/usr/local/ganglia --datarootdir=/home/ganglia --with-librrd=/usr/local/rrdtool-1.4.8 --with-gmetad
make
make install
六、執行
./gmetad -d 3
error while loading shared libraries: librrd.so.4
ln -s /usr/local/rrdtool-1.4.8/lib/librrd.so.4 /usr/local/lib/librrd.so.4
Going to run as user nobody Please make sure that /var/lib/ganglia/rrds exists: No such file or directory
mkdir -p /var/lib/ganglia/rrds
chown nobody.nobody /var/lib/ganglia/rrds
七、開機自啓動
cp gmetad/gmetad.init /etc/init.d/gmetad
chkconfig --add gmetad
chkconfig --list gmetad
cp gmond/gmond.init /etc/init.d/gmond
chkconfig --add gmond
chkconfig --list gmond
八、安裝nginx + php
1)安裝nginx
nginx-1.4.7.tar.gz
./configure --prefix=/usr/local/nginx \
--pid-path=/var/run/nginx.pid \
--error-log-path=/home/logs/nginx/error.log \
--http-log-path=/home/logs/nginx/access.log \
--with-http_stub_status_module
make
make install
cp nginx.init /etc/init.d/nginx
chmod +x /etc/init.d/nginx
chkconfig nginx on
chkconfig --list nginx
/etc/init.d/nginx
/bin/sh^M:bad interpreter: No such file or directory
解決辦法
:set ff 或 :set fileformat
能夠看到以下信息
fileformat=dos 或 fileformat=unix
利用以下命令修改文件格式
:set ff=unix 或 :set fileformat=unix
:wq (存盤退出)
最後再執行文件
統計
location /nginx_status {
stub_status on;
access_log off;
#allow SOME.IP.ADD.RESS;
#deny all;
}
2)安裝php
./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \#設置mysql的安裝路徑
--enable-fastcgi \ #開啓fastcgi支持
--enable-debug #支持調試
make
make install
3)對接
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
九、安裝gweb
ganglia-web-3.5.12.tar.gz
tar -zxvf ganglia-web-3.5.12.tar.gz
cd ganglia-web-3.5.12/
vim MakeFile
修改 GDESTDIR = /var/www/html/ganglia
修改 APACHE_USER = apache
x 保存
make install
沒有報錯即安裝成功
cd /var/www/html/ganglia
vim conf_default.php
修改 rrdtool 路徑: $conf['rrdtool'] = "/usr/local/rrdtool-1.4.8/bin/rrdtool"
訪問:http://server-ip/ganglia
可能存在權限問題,解決辦法:
cd /var/www/html
chown apache:apache ganglia/
十、gstat
cd /usr/bin ln -s /usr/local/ganglia/bin/gstat ./gstat gstat