天天看点

Ganglia安装篇

一、ganglia基本介绍

ganglia是分布式的监控系统,有两个Daemon,分别是:客户端GangliaMonitoring Daemon(gmond)和服务端GangliaMetaDaemon (gmetad),还有GangliaPHPWeb 

Ganglia是一个监控服务器,集群的开源软件,能够用曲线图表现最近一个小时,最近一天,最近一周,最近一月,最近一年的服务器或者集群的cpu负载,内存,网络,硬盘等指标。

Ganglia的强大在于:ganglia服务端能够通过一台客户端收集到同一个网段的所有客户端的数据,ganglia集群服务端能够通过一台服务端收集到它下属的所有客户端数据。这个体系设计表示一台服务器能够通过不同的分层能够管理上万台机器。这个功能是其他mrtg,nagios,cacti所不能比拟。

<a href="https://s4.51cto.com/wyfs02/M02/98/F4/wKiom1lCMIfzrQ6XAAFQNqjxBPc768.jpg-wh_500x0-wm_3-wmp_4-s_904607514.jpg" target="_blank"></a>

二、环境的准备

服务端:系统Centos6.5 64位

        运行环境:Apache Web Server PHP 5.2及更新版本 PHP JSON 扩展的安装和启用

       gmetad 服务,gmond服务(为了监控服务端服务安装的客户端服务)

客户端:系统Centos6.5 64位

         只安装gmond服务

1.安装php支持

 yum install php-common php-cliphp-gb php

2. 安装ganglia及其相关组件

server端:yum install httpd rrdtool rrdtool-devel  ganglia-gmetad ganglia-gmondganglia-gmond-python httpd apr-devel zlib-devel libconfuse-devel expat-develpcre-devel 

client端:yum install ganglia-gmond

3、检查状态并启动相关的服务

检查httpd是否启动:service httpd status

启动httpd:service httpd start

 检查gmetad是否启动: service gmetad status

启动gmetad:service gmetad start

检查本地gmond是否启动:service gmond status

启动gmond:service gmond start

4、关闭selinux

5、相关配置

客户端上的配置:

修改/etc/ganglia/gmond.conf

cluster {

 name = "cluster01"

 owner = "unspecified"

 latlong = "unspecified"

 url = "unspecified"

}

udp_send_channel {

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

                       # This option tellsgmond to use a source address

                       # that resolves to themachine's hostname.  Without

                       # this, the metrics mayappear to come from any

                      # interface andthe DNS names associated with

                       # those IPs will be usedto create the RRDs.

 mcast_join = 239.2.11.71

 port = 8649

 ttl = 1

/* You can specify as manyudp_recv_channels as you like as well. */

udp_recv_channel {

 bind = 239.2.11.71

 retry_bind = true

  #Size of the UDP buffer. If you are handling lots of metrics you really

  #should bump it up to e.g. 10MB or even higher.

  #buffer = 10485760

服务端上的配置:

 修改文件/etc/ganglia/gmetad.conf

 data_source "cluster01"localhost   // cluster01是gmond.conf中cluster里name的名字  localhost则需要是服务器端的ip

gridname "MyGrid"

6、访问服务

http://&lt;server ip address&gt;/ganglia2/目录“/ganglia2”可以在 ganglia-web的Makefile文件中GDESTDIR被修改,修改后需要重新编译

<a href="https://s2.51cto.com/wyfs02/M00/98/F4/wKioL1lCMMLw36zGAAFnqV43f1g732.png-wh_500x0-wm_3-wmp_4-s_644264145.png" target="_blank"></a>

参考:http://blog.csdn.net/avilifans/article/details/22685425

本文转自 holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/1937118