Ganglia添加SLES监控节点配置详解
说明:
此文档只涉及将SLES操作系统作为节点添加到现有的ganglia监控环境中,不包括搭建ganglia服务端内容。
OS :SLES 11 SP3_X64 Ganglia : ganglia 3.5.0
mkdir /opt/rpm
cd /opt/rpm
scp 192.168.3.1:/opt/20150121/* /opt/rpm/
unzip gangliarpm.zip
cd gangliarpm
rpm -ivh zlib-devel-1.2.7-0.10.128.x86_64.rpm
rpm -ivh freetype2-devel-2.3.7-25.32.1.x86_64.rpm
rpm -ivh libart_lgpl-devel-2.3.20-46.16.43.x86_64.rpm
rpm -ivh libpng-devel-1.2.31-5.31.1.x86_64.rpm
如果上述安装失败,可能需要安装以下库依赖
yum install zlib freetype libart_lgpl libpng
cd /opt/rpm/gangliarpm
tar zxvf rrdtool-1.2.27.tar
cd rrdtool-1.2.27
./configure --prefix=/usr/local/rrdtool
make
make install
/usr/local/rrdtool/bin/rrdtool
执行下命令,看是否安装成功
/usr/local/rrdtool/bin/rrdtool
cd /opt/rpm/gangliarpm
tar zxvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=/usr/local/expat
make
make install
mkdir /usr/local/expat/lib64
cp -a /usr/local/expat/lib/* /usr/local/expat/lib64/
对于64位操作系统,需要手动的拷贝下动态链接库到lib64下
mkdir /usr/local/expat/lib64
cp -a /usr/local/expat/lib/* /usr/local/expat/lib64/
cd /opt/rpm/gangliarpm
rpm -ivh libexpat-devel-2.0.1-88.34.1.x86_64.rpm
cd /opt/rpm/gangliarpm
tar zxvf apr-1.5.1.tar.gz
cd apr-1.5.1
./configure --prefix=/usr/local/apr
make
make install
cd /opt/rpm/gangliarpm
tar xvzf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --with-apr=/usr/local/apr --with-expat=/usr/local/expat
make
make install
/bin/cp -f /usr/local/apr/include/apr-1/* /usr/local/apr/include/
mkdir -p /usr/local/apr/lib64
/bin/cp -a -f /usr/local/apr/lib/* /usr/local/apr/lib64/
cd /opt/rpm/gangliarpm
tar zxvf confuse-2.7.tar.gz
cd confuse-2.7
./configure CFLAGS=-fPIC --disable-nls --prefix=/usr/local/confuse
make
make install
mkdir -p /usr/local/confuse/lib64
/bin/cp -a -f /usr/local/confuse/lib/* /usr/local/confuse/lib64/
cd /opt/rpm/gangliarpm
rpm -ivh pcre-devel-7.8-2.18.x86_64.rpm
现在才是安装ganglia的开始,下载ganglia-3.5.0,解压,安装
cd /opt/rpm/gangliarpm/
tar zxvf ganglia-3.5.0.tar.gz
cd ganglia-3.5.0
./configure --prefix=/usr/local/ganglia --with-librrd=/usr/local/rrdtool --with-libapr=/usr/local/apr --with-libexpat=/usr/local/expat --with-libconfuse=/usr/local/confuse --with-gmetad --enable-gexec --enable-status --sysconfdir=/etc/ganglia
make
make install
/bin/cp -f gmond/gmond.init.SuSE /etc/init.d/gmond
/bin/cp -f /usr/local/ganglia/sbin/gmond /usr/sbin/gmond
chkconfig -add gmond
gmond --default_config > /etc/ganglia/gmond.conf
修改配置文件/etc/ganglia/gmond.conf。
vim /etc/ganglia/gmond.conf
name改为"stbigdata",owner改为"root"。
cluster {
name="stbigdata"
owner="root"
latlong="unspecified"
url="unspecified"
}
关闭mcast_join,增加host项,设置指向地址。
#mcast_join = 239.2.11.71
host = 10.245.254.18
port = 8649
ttl = 1
}
注解掉mcast_join和bind。
udp_recv_channel {
#mcast_join = 239.2.11.71
port = 8649
#bind = 239.2.11.71
#retry_bind = true
}
启动gmond服务
service gmond restart