Ganglia离线安装笔记
依赖资源: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
./configure
make
make install
./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
./configure
make
make install
./configure --prefix=/usr/local/rrdtool-1.4.8 --datarootdir=/home/rrdtool
make
make install
/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
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
chkconfig --add gmetad
chkconfig --list gmetad
cp gmond/gmond.init /etc/init.d/gmond
chkconfig --add gmond
chkconfig --list gmond
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;
}
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/
ln -s /usr/local/ganglia/bin/gstat ./gstat
gstat
参考:
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
1、安装pixman
pixman-0.10.0.tar.gz./configure
make
make install
2、安装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
3、安装pango
pango-1.17.5.tar.gz./configure
make
make install
4、安装rrdtool
rrdtool-1.4.8.tar.gz./configure --prefix=/usr/local/rrdtool-1.4.8 --datarootdir=/home/rrdtool
make
make install
5、安装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
6、执行
./gmetad -d 3error 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
7、开机自启动
cp gmetad/gmetad.init /etc/init.d/gmetadchkconfig --add gmetad
chkconfig --list gmetad
cp gmond/gmond.init /etc/init.d/gmond
chkconfig --add gmond
chkconfig --list gmond
8、安装nginx + php
1)安装nginxnginx-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;
}
9、安装gweb
ganglia-web-3.5.12.tar.gztar -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/
10、gstat
cd /usr/binln -s /usr/local/ganglia/bin/gstat ./gstat
gstat