ganglia安装配置-2

来源:互联网 发布:android全景拍照源码 编辑:程序博客网 时间:2024/05/22 06:35

介绍:

你找到这篇文章就说明你对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

[plain] view plaincopy
  1. override_hostname = "crdc-c210-141"  
  2. cluster {  
  3.   name = "Test Team"  
  4.   owner = "Benjamin Wang"  
  5.   latlong = "unspecified"  
  6.   url = "unspecified"  
  7. }  
  8. /* The host section describes attributes of the host, like the location */  
  9. host {  
  10.   location = "crdc-c210-141"  
  11. }  
  12.   
  13. udp_send_channel {  
  14.   #bind_hostname = yes # Highly recommended, soon to be default.  
  15.                        # This option tells gmond to use a source address  
  16.                        # that resolves to the machine's hostname.  Without  
  17.                        # this, the metrics may appear to come from any  
  18.                        # interface and the DNS names associated with  
  19.                        # those IPs will be used to create the RRDs.  
  20.   mcast_join = 239.2.11.141  
  21.   port = 8649  
  22.   ttl = 1  
  23. }  
  24.   
  25. /* You can specify as many udp_recv_channels as you like as well. */  
  26. udp_recv_channel {  
  27.   mcast_join = 239.2.11.141  
  28.   port = 8649  
  29.   bind = 239.2.11.141  
  30.   retry_bind = true  
  31.   # Size of the UDP buffer. If you are handling lots of metrics you really  
  32.   # 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

[plain] view plaincopy
  1. GMOND=/usr/local/sbin/gmond  
  2. 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

[plain] view plaincopy
  1. 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

[plain] view plaincopy
  1. GMETAD=/usr/local/sbin/gmetad  
  2. 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

[plain] view plaincopy
  1. ServerName localhost:80  
  2. DocumentRoot "/var/www/html"  
  3. <Directory "/var/www/html">  
  4.   
  5. <IfModule dir_module>  
  6.     DirectoryIndex index.php index.html  
  7. </IfModule>  
  8.   
  9. LoadModule php5_module modules/libphp5.so  
  10.   
  11. AddType  application/x-httpd-php         .php .php4 .php3 .phtml  
  12. 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";
0 0
原创粉丝点击