Ganglia安装实例

介绍:

你找到这篇文章就说明你对Ganglia有起码了解,我就不详细介绍了,具体内容可以看http://ganglia.sourceforge.net/

个人感觉Ganglia最强的是把网络监控功能分担到多个子节点来负担。其具体组织结构是:

TopGrid

    - SubGrid1

        - SubGrid1-Cluster1

        - SubGrid1-Cluster2

    - SubGrid2

        -SubGrid2-Cluster1

        -SubGrid2-Cluster2

    - TopGrid-Cluster1

    - TopGrid-Cluster2

Grid结构中可以包含Grid结构和Cluster结构,Cluster下面直接包含需要管理的Node, Grid结构可以嵌套。Cluster内部使用单播/组播来进行通信,Cluster中每个Node含有这个Cluster所有Node的信息。Grid之间使用TCP来进行通信。一般每个Node上面部署一个gmond,一个Grid有一个gmetad和PHP Web.


Install the standalone gmond:

1. Install the libConfuse

# ./configure --enable-shared
# make
# make install

2. Install the gmond

# ./configure
# make
# make install

3. Create the configuration file

# mkdir -p /etc/ganglia/
# gmond --default_config > /etc/ganglia/gmond.conf

4. Change the configuration file

override_hostname = "crdc-c210-141"
cluster {
  name = "Test Team"
  owner = "Benjamin Wang"
  latlong = "unspecified"
  url = "unspecified"
}
/* The host section describes attributes of the host, like the location */
host {
  location = "crdc-c210-141"
}

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.141
  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.141
  port = 8649
  bind = 239.2.11.141
  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.

5. Start gmond

# gmond --conf /etc/ganglia/gmond.conf

6. Verify gmond running

# telnet localhost 8649

7. Setup the init.d script

# cp /root/tools/ganglia-3.6.0/gmond/gmond.init /etc/rc.d/init.d/gmond

8. Update the init.d script

GMOND=/usr/local/sbin/gmond
daemon $GMOND --conf /etc/ganglia/gmond.conf

# chkconfig --add gmond

9. Start/Stop gmond

# /etc/init.d/gmond start
# /etc/init.d/gmond stop


Install the gmetad and the PHP Web:

1. Install the libConfuse

# ./configure --enable-shared
# make
# make install

2. Install the Libtool

# ./configure
# make
# make install

3. Install APR

# ./configure
# make
# make install
# ln -s /usr/local/apr/lib /usr/local/apr/lib64
# cp /usr/local/apr/include/apr-1/* /usr/local/apr/include

4. Install the Gmetad

# ./configure --with-librrd=/opt/rrdtool-1.4.7 --with-libapr=/usr/local/apr --with-gmetad
# make
# make install
# mkdir -p /var/lib/ganglia/rrds
# chown nobody:nobody /var/lib/ganglia/rrds

5. Create the configuration file for the gmetad

# mkdir -p /etc/ganglia/
# cp /usr/local/etc/gmetad.conf /etc/ganglia/

6. Change the configuration file

data_source "Test Team" 10.74.125.141

7. Start gmetad

# gmetad --conf=/etc/ganglia/gmetad.conf

8. Setup the init.d script

# cp /root/tools/ganglia-3.6.0/gmetad/gmetad.init /etc/rc.d/init.d/gmetad

9. Update the init.d script

GMETAD=/usr/local/sbin/gmetad
daemon $GMETAD --conf=/etc/ganglia/gmetad.conf

# chkconfig --add gmetad

10. Start/Stop gmetad

# /etc/init.d/gmetad start
# /etc/init.d/gmetad stop

11. Install Apache

   download the latest versions of both APR and APR-Util from Apache APR, unpack them into ./srclib/apr and ./srclib/apr-util (be sure the domain names do not have 
version numbers)
# ./configure --with-included-apr
# make
# make install

12. Install PHP

# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php5
# make
# make install

13. Change PHP configuration

# cp ./php.ini-development /usr/local/php5/php.ini
date.timezone = Asia/Shanghai

14. Install PHP Web

# mkdir -p /var/www/html
# cp /usr/local/apache2/htdocs/index.html /var/www/html/


unpack PHP Web package
# mv ganglia-web-3.5.8/ ganglia

15. Change Apache configuration

ServerName localhost:80
DocumentRoot "/var/www/html"
<Directory "/var/www/html">

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

LoadModule php5_module modules/libphp5.so

AddType  application/x-httpd-php         .php .php4 .php3 .phtml
AddType  application/x-httpd-php-source  .phps

16. Start/Stop Test apache2

/usr/local/apache2/bin/apachectl -k start
/usr/local/apache2/bin/apachectl -k stop

17. Change PHP Web configuration

# mkdir -p /var/www/html/ganglia/dwoo/compiled
# mkdir -p /var/www/html/ganglia/dwoo/cache
# chmod 777 /var/www/html/ganglia/dwoo/compiled
# chmod 777 /var/www/html/ganglia/dwoo/cache


# cp /var/www/html/ganglia/conf_default.php /var/www/html/ganglia/conf.php
$conf['gweb_confdir'] = "/var/www/html/ganglia";
$conf['rrdtool'] = "/opt/rrdtool-1.4.7/bin/rrdtool";

你可能感兴趣的:(ganglia,gmond,gmetad)