Recently, Ganglia was installed. since the Linux base was basically 0, it took a great deal of trouble. Finally, after many failures, I finally saw the coveted web interface. The following is a summary of my work over the past few days. Ganglia is a monitoring software that includes three parts: Gmond, Gmetad, and Gweb. Install Gmond on the host to be monitored. Gmetad collects information about the current host. Gmetad is deployed on the server side. it trains the host and collects the host information collected by Gmond.
Recently, Ganglia was installed. since the Linux base was basically 0, it took a great deal of trouble. Finally, after many failures, I finally saw the coveted web interface. The following is a summary of my work over the past few days.
Ganglia is a monitoring software that includes three parts: Gmond, Gmetad, and Gweb. Install Gmond on the host to be monitored. Gmetad collects information about the current host. Gmetad is deployed on the server side. it trains the host and collects the host information collected by Gmond, then it is stored in the rrdtool Database. Gweb is a front-end interface that reads the rrd file saved by Gmetad and displays it on the web interface.
Deployment plan:
| Host |
IP |
| Leo |
192.168.137.101 (client) |
| Sherry |
192.168.137.66 (server) |
Installation steps: 1. install the dependent package
[Plain]View plaincopyprint?
- Rpm-q gcc glibc-common rrdtool-devel apr-devel expat-devel pcre-devel dejavu-lgc-sans-mono-fonts dejavu-sans-mono-fonts
- Gcc-4.4.7-3.el6.x86_64
rpm -q gcc glibc glibc-common rrdtool rrdtool-devel apr apr-devel expat expat-devel pcre pcre-devel dejavu-lgc-sans-mono-fonts dejavu-sans-mono-fontsgcc-4.4.7-3.el6.x86_64
Which one is missing, directly installed using yum
[Html]View plaincopyprint?
- Yum-y install **
yum -y install **
2. confuse installation
: Confuse-2.7 http://www.nongnu.org/confuse /.
[Plain]View plaincopyprint?
- Wget http://www.nongnu.org/confuse/
wget http://www.nongnu.org/confuse/
[Plain]View plaincopyprint?
- Tar-zxf confuse-2.7.tar.gz
- Cd confuse-2.7
- ./Configure CFLAGS =-fPIC -- disable-nls
- Make & make install
tar -zxf confuse-2.7.tar.gzcd confuse-2.7./configure CFLAGS=-fPIC --disable-nlsmake && make install
3. Python installation
I don't understand why I want to install this ..
[Plain]View plaincopyprint?
- Wget http://www.python.org/
wget http://www.python.org/
[Plain]View plaincopyprint?
- Tar-jxf Python-2.7.3.tar.bz2
- ./Configure -- prefix =/usr/local -- enable-shared
- Make & make install
tar -jxf Python-2.7.3.tar.bz2./configure --prefix=/usr/local --enable-shared make && make install
Configure the shared library
[Plain]View plaincopyprint?
- Vi/etc/ld. so. conf
- -- Add the following content:
- /Usr/local/lib
Vi/etc/ld. so. conf -- add the following content:/usr/local/lib
Enable configuration
Ldconfig
Check for effectiveness
Ldconfig-v | grep "libpython2.7.so"
4. install Gmond on the clientBecause the client only needs to install Gmond, it is relatively simple.
[Plain]View plaincopyprint?
- Tar-zxf ganglia-3.6.0.tar.gz
- # Cd ganglia-3.6.0
- #./Configure -- prefix =/usr/local/ganglia
tar -zxf ganglia-3.6.0.tar.gz# cd ganglia-3.6.0# ./configure --prefix=/usr/local/ganglia
After the installation, claim the Gmond configuration file and modify:
[Html]View plaincopyprint?
-
Gmond -- default_config>/usr/local/ganglia/etc/gmond. conf
gmond --default_config > /usr/local/ganglia/etc/gmond.conf
[Html]View plaincopyprint?
- Vi/usr/local/ganglia/etc/gmond. conf
vi /usr/local/ganglia/etc/gmond.conf
This name is the cluster name and must correspond to the server.
We can add Gmond to the startup script.
[Plain]View plaincopyprint?
-
Cp-f ganglia-3.6.0/gmond. init/etc/init. d/gmond
cp -f ganglia-3.6.0/gmond/gmond.init /etc/init.d/gmond
[Plain]View plaincopyprint?
- Vi/etc/init. d/gmond
vi /etc/init.d/gmond
[Plain]View plaincopyprint?
- GMOND =/usr/
Local
/Ganglia/sbin/gmond
GMOND=/usr/local/ganglia/sbin/gmond
In this way, we have configured and started Gmond.
[Html]View plaincopyprint?
- Service gmond start
service gmond start
We can check through telnet
5. server installation and configurationThe preceding operations are the same as those on the client. during re-compilation, since we need to install gmetad here, we need to add -- with-gmetad
[Plain]View plaincopyprint?
- ./Configure -- prefix =/usr/local/ganglia -- with-gmetad -- enable-gexec -- with-python =/usr/local
./configure --prefix=/usr/local/ganglia --with-gmetad --enable-gexec --with-python=/usr/local
Modify configuration file
[Plain]View plaincopyprint?
- Vi/usr/local/ganglia/etc/gmetad. conf
vi /usr/local/ganglia/etc/gmetad.conf
This is the data source we need to collect. The first is the cluster name, and the second is the ip address of the host in the cluster.
Rrd_rootdir is the location where data is collected to the storage. We can see that the default storage path is/var/lib/ganglia/rrds. We can customize the storage location. I did not. I used this location directly. Therefore, you need to create a directory
[Plain]View plaincopyprint?
- Mkdir/var/lib/ganglia/rrds
mkdir /var/lib/ganglia/rrds
We need to change the permission of this directory. Otherwise, the interface will not be displayed if no data is collected on Gweb.
[Plain]View plaincopyprint?
- Chown-R nobody: nobody/var/lib/ganglia/rrds
chown -R nobody:nobody /var/lib/ganglia/rrds
OK. Gmetad configuration is complete.
6. install and configure GwebI think this part is the most difficult to configure, and many errors have been made in this step...
In fact, Gweb is a front-end program that relies on apache and php. For details about how to configure the two, refer to this post:
We think apache and php have been configured. Let's start Gweb.
Download and decompress
[Plain]View plaincopyprint?
- Tar-zxf ganglia-web-3.5.10.tar.gz
tar -zxf ganglia-web-3.5.10.tar.gz
Copy the ganglia-web-3.5.10 Directory. you can set the location by yourself. I got this location.
[Plain]View plaincopyprint?
- /Var/lib/ganglia-web-3.5.10
/var/lib/ganglia/ganglia-web-3.5.10
Go to this directory and modify its configuration file.
He has a default configuration file conf_defalut.php. The program first looks for conf. php. If this file is not available, it will read conf_default.php.
[Html]View plaincopyprint?
-
Cp conf_default.php conf. php
cp conf_default.php conf.php
[Html]View plaincopyprint?
- Vi conf. php
vi conf.php
You can check the following parameters.
The following parameter specifies the gweb home directory. in my opinion, webpage data can be read here when the interface is displayed on the foreground.
The following rrds is the location where gweb reads the rrd data stored in gmetad. Gmetad_root hasn't understood it yet .... It's okay.
The following is a php-compiled templates storage. we need to create these two files in the corresponding location and modify their permissions.
This is the path to the rrdtool Directory. because we have installed yum, we do not need to modify it here.
OK. Finally, it's done...
7. page display
8. NotesDuring the installation process, some errors are inevitable. for example, if some packages are missing, you can install them using Yum or source code. In addition, the front-end interface may not be displayed. this is probably because seLinux is not closed. The method for disabling seLinux is cd/usr/local setenforce 0.
[Javascript]View plaincopyprint?