| 1 | 以下動作皆在 DRBL server 上處理 |
| 2 | |
| 3 | 1. Ganglia |
| 4 | |
| 5 | 1.1 Install (Base on Ubuntu Dapper) |
| 6 | 1.1.1 Install necessary package from repository : apache2-php4, php4-gd, php4-jpgraph, php4-rrdtool, rrdtool, gcc, g++, libc6, librrd2-dev |
| 7 | 1.2 Download last stable version ganglia |
| 8 | http://sourceforge.net/project/showfiles.php?group_id=43021&package_id=35280 |
| 9 | (In our case, use "ganglia-3.0.4.tar.gz" ) |
| 10 | 1.3 Uncompree package, and configure and make |
| 11 | $ tar xzvf ganglia-3.0.4.tar.gz; cd /ganglia-3.0.4 |
| 12 | $ ./configure --with-gmetad --prefix=/opt/ganglia |
| 13 | $ make |
| 14 | $ sudo make install |
| 15 | 1.4 Install Web Frontend: |
| 16 | $ cp -a web /var/www/ganglia |
| 17 | 1.2 Configure |
| 18 | 1.2.0 Add a user, group for ganglia service, say "ganglia:ganglia" |
| 19 | 1.2.1 On frontend, create a gmond configuration file named gmond.conf |
| 20 | $ /opt/ganglia/sbin/gmond --default_config > /etc/gmond.conf |
| 21 | |
| 22 | $ vi /etc/gmond.conf |
| 23 | globals { |
| 24 | daemonize = yes |
| 25 | setuid = yes |
| 26 | user = ganglia -------------> match 1.2.0 |
| 27 | debug_level = 0 |
| 28 | max_udp_msg_len = 1472 |
| 29 | mute = no |
| 30 | deaf = no |
| 31 | host_dmax = 0 /*secs */ |
| 32 | cleanup_threshold = 300 /*secs */ |
| 33 | gexec = no |
| 34 | } |
| 35 | |
| 36 | |
| 37 | cluster { |
| 38 | name = "DRBL Cluster Project" -------------> as you want |
| 39 | owner = "NCHC OSS Lab" -------------> as you want |
| 40 | latlong = "unspecified" |
| 41 | url = "unspecified" |
| 42 | } |
| 43 | udp_send_channel { |
| 44 | host = 192.168.201.254 ---------------> match your LAN connection ip |
| 45 | port = 8649 |
| 46 | } |
| 47 | 1.2.2 On frontend, create a Gmetad configuration file named gmetad.conf |
| 48 | $ cp /opt/src/ganglia-3.0.4/gmetad/gmetad.conf /etc/gmetad.conf |
| 49 | $ vi /etc/gmetad.conf |
| 50 | data_source "Test Cluster" 127.0.0.1:8649 |
| 51 | |
| 52 | trusted_hosts 127.0.0.1 |
| 53 | |
| 54 | setuid_username "ganglia" |
| 55 | |
| 56 | 1.2.3 On frontend, edit web frontend configuration file named conf.php |
| 57 | $ vi /var/www/ganglia/conf.php |
| 58 | $gmetad_root = "/var/lib/ganglia"; |
| 59 | $rrds = "$gmetad_root/rrds"; |
| 60 | |
| 61 | define("RRDTOOL", "/usr/bin/rrdtool"); |
| 62 | |
| 63 | $ganglia_ip = "127.0.0.1"; |
| 64 | |
| 65 | 1.3 Setup Ganglia service and start up |
| 66 | 1.3.1 Perpare rrd log directory |
| 67 | $ mkdir -p /var/lib/ganglia/rrds |
| 68 | $ chown ganglia:ganglia /var/lib/ganglia/rrds |
| 69 | |
| 70 | 1.3.2 Setup service on /etc/rc.local ---------> client 要保留,或以其他方式起動 |
| 71 | $ vi /ect/rc.local |
| 72 | # Start up ganglia service |
| 73 | /opt/ganglia/sbin/gmond |
| 74 | /opt/ganglia/sbin/gmetad --------> client 則可以不用 |
| 75 | |
| 76 | 1.3.3 Start up necessary service |
| 77 | $ /opt/ganglia/sbin/gmetad |
| 78 | $ /opt/ganglia/sbin/gmond |
| 79 | |
| 80 | 1.4 Setup frontend php web page |
| 81 | 1.4.1 Copy necessary frontend php scripts |
| 82 | $ cp -a /opt/src/ganglia-3.0.4/web /var/www/ganglia |
| 83 | 1.4.2 Make sure the follow session is correct in config.conf |
| 84 | $ vi /var/www/ganglia/conf.php |
| 85 | |
| 86 | $gmetad_root = "/var/lib/ganglia"; |
| 87 | $rrds = "$gmetad_root/rrds"; |
| 88 | |
| 89 | define("RRDTOOL", "/usr/bin/rrdtool"); |
| 90 | |
| 91 | $ganglia_ip = "127.0.0.1"; |