天天看點

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