CentOS6.5安装ganglia3.6
参考来源:
1.http://yhz.me/blog/Install-Ganglia-On-CentOS.html
2.http://blog.csdn.net/sdlyjzh/article/details/26560585
安装基本的php,curl,尽量装吧,相关的都安装好.
更新源
yum install wget gcc make rsync
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum makecache
安装依赖包
-
apr-devel
yum install apr-devel
-
zlib
yum install zlib-devel
-
libConfuse
http://www.nongnu.org/confuse/ yum install libconfuse-devel
-
expat
http://expat.sourceforge.net yum install expat-devel
-
pcre
yum install pcre-devel
-
RRD
http://oss.oetiker.ch/rrdtool yum install rrdtool rrdtool-devel
安装Ganglia
http://ganglia.info/
wget http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz/download -O ~/ganglia-3.6.0.tar.gz
tar zxvf ganglia-3.6.0.tar.gz
cd ganglia-3.6.0
./configure --prefix=/usr/local/ganglia-3.6.0 --enable-gexec --enable-status --with-gmetad --with-librrd --with-libconfuse --with-zlib
make
make install
配置
设置软链接
ln -s /usr/local/ganglia-3.6.0/sbin/gmond /usr/bin/gmond
安装好后,声明Gmond配置文件,并修改:
gmond --default_config > /usr/local/ganglia-3.6.0
/etc/gmond.conf
cluster { name = "ganglia.monitor" owner = "unspecified" latlong = "unspecified" url = "unspecified" } udp_send_channel { host = ganglia.monitor port = 8649 ttl = 1 } udp_recv_channel { port = 8649 } tcp_accept_channel { port = 8649 }
我们可以把Gmond添加到启动脚本
cp -f ganglia-3.6.0/gmond/gmond.init /etc/init.d/gmond
vi /etc/init.d/gmond GMOND=/usr/local/ganglia-3.6.0/sbin/gmond
服务器端安装配置
vi /usr/local/
/etc/gmetad.conf ganglia-3.6.0
setuid_username "nobody" data_source "ganglia.monitor" localhost
设置RRD存储
mkdir -p /var/lib/ganglia/rrds chown -R nobody:nobody /var/lib/ganglia/rrds
安装Web
yum install php-common php-cli php php-gd httpd
下载
wget http://sourceforge.net/projects/ganglia/files/ganglia-web/3.5.12/ganglia-web-3.5.12.tar.gz/download -O ~/ganglia-web-3.5.12.tar.gz tar zxvf ganglia-web-3.5.12.tar.gz cd ganglia-web-3.5.12
修改Makefile vi Makefile # Location where gweb should be installed to (excluding conf, dwoo dirs). GDESTDIR = /var/www/html/ganglia # Location where default apache configuration should be installed to. GCONFDIR = /etc/ganglia-web # Gweb statedir (where conf dir and Dwoo templates dir are stored) GWEB_STATEDIR = /var/lib/ganglia-web # Gmetad rootdir (parent location of rrd folder) GMETAD_ROOTDIR = /var/lib/ganglia APACHE_USER = apache
安装
make install
防火墙规则设置 iptables -I INPUT 3 -p tcp -m tcp --dport 80 -j ACCEPT iptables -I INPUT 3 -p udp -m udp --dport 8649 -j ACCEPT service iptables save service iptables restart
关闭selinux vi /etc/selinux/config SELINUX=disabled setenforce 0
单播模式的配置及防火墙设置的一点经验
设置多个data_source
data_source "ganglia.monitor1" localhost:6149
data_source "ganglia.monitor2" host1:6150
data_source "ganglia.monitor3" host1:6151
客户端配置:
cluster { name = "ganglia.monitor2" owner = "unspecified" latlong = "unspecified" url = "unspecified" } udp_send_channel { host = host1 port = 8650 ttl = 1 } udp_recv_channel { port = 8650 } tcp_accept_channel { port = 8650 }
根据个人经验,ganglia.monitor2小集群内的每台机器都要开放udp8650端口,同时,集群的主节点host1需要开发tcp8650端口;
其他方面,继续实践中.