Install Ganglia3.6.0 and configure Ganglia3.6.0 in Centos6.x

Source: Internet
Author: User

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 IPLeo192.168.137.101 (client) Sherry192.168.137.66 (server)Installation Steps: 1. Install the dependency package [plain] view plaincopyprint?
  1. Rpm-qgccglibcglibc-commonrrdtoolrrdtool-develaprapr-develexpatexpat-develpcrepcre-develdejavu-lgc-sans-mono-fontsdejavu-sans-mono-fonts
  2. 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?
  1. Yum-yinstall **
yum -y install **
2. confuse Installation

: Confuse-2.7http: // www.nongnu.org/confuse/, you can select a version

[Plain] view plaincopyprint?
  1. Wget <atarget = _ blankhref = "http://www.nongnu.org/confuse/" rel = "nofollow"> http://www.nongnu.org/confuse/ </a>
wget <a target=_blank href="http://www.nongnu.org/confuse/" rel="nofollow">http://www.nongnu.org/confuse/</a>
[Plain] view plaincopyprint?
  1. Tar-zxfconfuse-2.7.tar.gz
  2. Cdconfuse-2.7
  3. ./ConfigureCFLAGS =-fPIC -- disable-nls
  4. Make & makeinstall
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?
  1. <Preclass = "plain" name = "code" snippet_file_name = "inherit" code_snippet_id = "357828"> wget <atarget = _ blankhref = "http://www.python.org/" rel = "nofollow"> http://www.python.org /</a>
<pre class="plain" name="code" snippet_file_name="blog_20140522_6_1186095" code_snippet_id="357828">wget <a target=_blank href="http://www.python.org/" rel="nofollow">http://www.python.org/</a>
[Plain] view plaincopyprint?
  1. Tar-jxfPython-2.7.3.tar.bz2
  2. ./Configure -- prefix =/usr/local -- enable-shared
  3. Make & makeinstall
tar -jxf Python-2.7.3.tar.bz2./configure  --prefix=/usr/local  --enable-shared make && make install
 

Configure the Shared Library

[Plain] view plaincopyprint?
  1. Vi/etc/ld. so. conf
  2. -- Add the following content:
  3. /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 client

Because the client only needs to install Gmond, it is relatively simple.

[Plain] view plaincopyprint?
  1. Tar-zxfganglia-3.6.0.tar.gz
  2. # Cdganglia-3.6.0
  3. #./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?
  1. <Preclass = "html" name = "code" snippet_file_name = "inherit" code_snippet_id = "357828"> <spanstyle = "font-family: Tahoma, sans-serif; font-size: 9pt; "> gmond -- default_config>/usr/local/ganglia/etc/gmond. conf </span>
<pre class="html" name="code" snippet_file_name="blog_20140522_10_7379893" code_snippet_id="357828"><span style="font-family:Tahoma, sans-serif;font-size: 9pt;">gmond --default_config > /usr/local/ganglia/etc/gmond.conf</span>
[Html] view plaincopyprint?
  1. 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?
  1. <Preclass = "plain" name = "code" snippet_file_name = "blog_20140522_12_1556589" code_snippet_id = "357828"> cp-fganglia-3.6.0/gmond. init/etc/init. d/gmond
<pre class="plain" name="code" snippet_file_name="blog_20140522_12_1556589" code_snippet_id="357828">cp -f ganglia-3.6.0/gmond/gmond.init  /etc/init.d/gmond
[Plain] view plaincopyprint?
  1. <Spanstyle = "line-height: 23px;"> vi/etc/init. d/gmond </span>
<span style="line-height: 23px;">vi/etc/init.d/gmond </span>
[Plain] view plaincopyprint?
  1. GMOND =/usr/<codeclass = "bashfunctions"> local </code> <codeclass = "bashzain">/ganglia/sbin/gmond </code>
GMOND=/usr/<code class="bash functions">local</code><code class="bash plain">/ganglia/sbin/gmond</code>
 

In this way, we have configured and started Gmond.

[Html] view plaincopyprint?
  1. Servicegmondstart
service gmond start

We can check through telnet

5. Server installation and configuration

The 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?
  1. ./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?
  1. 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?
  1. 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?
  1. Chown-Rnobody: nobody/var/lib/ganglia/rrds
chown -R nobody:nobody /var/lib/ganglia/rrds

OK. Gmetad configuration is complete.

6. install and configure Gweb

I 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?
  1. Tar-zxfganglia-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?
  1. /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?
  1. <Preclass = "html" name = "code" snippet_file_name = "blog_20140522_22_5404099" code_snippet_id = "357828"> cpconf_default.phpconf.php
<pre class="html" name="code" snippet_file_name="blog_20140522_22_5404099" code_snippet_id="357828">cp conf_default.php conf.php
[Html] view plaincopyprint?
  1. Viconf. 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. Notes

During 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?
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.