ganglia监控的安装

 以前安装过ganglia的监控,过程比较复杂,最近在新的集群环境下部署了监控,这里做个笔记。

ganglia监控的架构图如下,相关的原理这里不多说了。

1、配置yum的源
这里利用公司的yum源,增加wxlab136.repo到/etc/yum.repos.d目录下
[Server]
name=10.1.1.136
#baseurl=ftp://10.1.1.136/pub/Packages
baseurl=ftp://10.1.1.136/RHEL6.2/Packages
enabled=1
gpgcheck=0

[isolinux]
name=wxlab136
#baseurl=ftp://10.1.1.136/pub/isolinux
baseurl=ftp://10.1.1.136/RHEL6.2/isolinux
enabled=1
gpgcheck=0




2、安装依赖包
yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel \
rpmbuild glib2-devel dbus-devel freetype-devel fontconfig-devel gcc-c++ expat-devel \
python-devel libXrender-devel pcre pcre-devel 


libconfuse的安装(自己使用google搜索下载地址):
wget http://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz 
tar -zxvf confuse-2.7.tar.gz 
cd confuse-2.7 
./configure CFLAGS=-fPIC --disable-nls 
make && make install 

调整lib库的位置:
vi /etc/ld.so.conf.d/libconfuse.conf,添加:/usr/local/lib,然后/sbin/ldconfig -v


wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar zxvf rrdtool*
cd rrdtool-*
./configure --prefix=/usr
make -j8
make install
which rrdtool
ldconfig
ldconfig -p | grep rrd # make sure you have the new rrdtool libraries linked.

数据存放在/var/lib/ganglia/rrds目录中

3、安装Ganglia
cd ganglia-3.1.7/
./configure --with-gmetad --sysconfdir=/etc/ganglia
make -j8
make install


ganglia的配置
1) cd /opt/3rdparty/ganglia-3.1.7/ # you should already be in this directory
2) mkdir -p /var/www/html/ganglia/ # make sure you have apache installed
3) cp -a web/* /var/www/html/ganglia/ # this is the web interface
4) cp gmetad/gmetad.init /etc/rc.d/init.d/gmetad # startup script
5) cp gmond/gmond.init /etc/rc.d/init.d/gmond
6) mkdir /etc/ganglia # where config files go,if existing ,no making
7) gmond -t | tee /etc/ganglia/gmond.conf # generate initial gmond config,if existing ,no making
8) cp gmetad/gmetad.conf /etc/ganglia/ # initial gmetad configuration
9) mkdir -p /var/lib/ganglia/rrds # place where RRDTool graphs will be stored
10) chown nobody:nobody /var/lib/ganglia/rrds # make sure RRDTool can write here.
11) chkconfig --add gmetad # make sure gmetad starts up at boot time
12) chkconfig --add gmond # make sure gmond starts up at boot time


[root@wxlab59 ~]# tcpdump -i bond0 host 192.168.1.17


gmond的配置:

cluster {

  name = "my cluster"

  owner = "nobody"

  latlong = "unspecified"

  url = "unspecified"

}

/* The host section describes attributes of the host, like the location */

host {

  location = "unspecified"

}

/* Feel free to specify as many udp_send_channels as you like.  Gmond

   used to only support having a single channel */

udp_send_channel {

  #bind_hostname = yes # Highly recommended, soon to be default.

                       # This option tells gmond to use a source address

                       # that resolves to the machine's hostname.  Without

                       # this, the metrics may appear to come from any

                       # interface and the DNS names associated with

                       # those IPs will be used to create the RRDs.

  mcast_join = 239.2.11.71

  #mcast_join = 192.168.1.59

  #host=192.168.1.59

  port = 8649

  ttl = 1

}


/* You can specify as many udp_recv_channels as you like as well. */

udp_recv_channel {

  mcast_join = 239.2.11.71

  port = 8649

  #port = 8649

  bind = 239.2.11.71

}


/* You can specify as many tcp_accept_channels as you like to share

   an xml description of the state of the cluster */

tcp_accept_channel {

  port = 8649

}


gmetad的配置:

rrd_rootdir "/var/lib/ganglia/rrds"

data_source "my cluster" 5  192.168.1.17:8649



4、安装apache

sudo yum –y install apr-util-devel apr-devel apr-util

wget http://labs.renren.com/apache-mirror/httpd/httpd-2.0.64.tar.gz

tar –zxvf  httpd-2.0.64 .tar.gz

cd httpd-2.0.64

./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-rewrite

make

sudo make install


配置Apache服务的httpd.conf文件

*在LoadModule处添加 LoadModule php5_module module/libphp5.so

*在DirectoryIndex处添加 index.php
*在AddType application处添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps

    <FilesMatch /.php$> 
SetHandler application/x-httpd-php 
</FilesMatch> 
<FilesMatch "/.ph(p[2-6]?|tml)$"> 
SetHandler application/x-httpd-php 
</FilesMatch> 
<FilesMatch "/.phps$"> 
SetHandler application/x-httpd-php-source 
</FilesMatch> 

LoadModule php5_module modules/libphp5.so 

<IfModule dir_module> 
DirectoryIndex index.html index.php 
</IfModule>


 cd  /usr/local/apache2/htdocs

mkdir ganglia

cd ganglia 

cp -a /var/www/html/ganglia/* .


5、安装PHP5

#安装php5的依赖

sudo yum –y install freetype-devel libjpeg-turbo-devel libpng-devel GD-devel libxml2-devel

wget http://cn.php.net/get/php-5.3.6.tar.gz/from/this/mirror

tar –zxvf php-5.3.6.tar.gz

cd php-5.3.6

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/lib --with-mysql=/usr/local/mysql
make

cp -p .libs/libphp5.so /usr/local/apache2/modules

#sudo chown cdh:cdh /usr/local/apache2/modules/libphp5.so

#复制php5配置文件

sudo cp php.ini-development/usr/local/php/lib/php/php.ini

sudo make install 


vi /usr/local/php/lib/php/php.ini

output_buffering = On

 date.timezone = Asia/Chongqing


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值