Now there is a scenario where you need to build a ganglia monitoring framework on the server, but without root privileges, you can only use the "compile and install from source" approach. Next describes how to install ganglia Gmond,gmetad and gweb from the source code.
First, from the source installation Gmond
1.1. Software dependencies
Requires Libconfuse, Pkgconfig, PCRE, Apr,expat software dependencies
1.2. Specific software version
confuse-2.7,pkg-config_0.26,pcre-8.37,apr-1.5.2,expat-2.1.0,ganglia-3.7.2
1.3. Installation Script
#!/bin/bash installdir= "/home/dsl/bigdisk/testdisk/usr/local" prefix= $INSTALLDIR exec_prefix= $INSTALLDIR oldincludedir= $INSTALLDIR/oldinclude dependency_path= $INSTALLDIR/lib/pkgconfig #install confuse CD confuse-2.7. Configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir make make install echo "Finish
Installing confuse "CD.
#install pcre cd pcre-8.37/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir make
Make install echo "Finish installing Pcre" CD.
#install Apr cd apr-1.5.2./configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir make
Make install echo "Finish installing Apr" CD.
#install Expat CD expat-2.1.0/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir
Make make install echo "Finish installing Expat" CD. #install gmond cd ganglia-3.7.2/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$ Oldincludedir pkg_confIg_path= $dependency _path cflags= "-i$installdir/include" make make and install CD.
1.4. Precautions
1. In this practice, Pkgconfig has been pre-installed with apt-get mechanism
2, when compiling the ganglia-3.7.2 project, to set the CFLAGS environment variable as above, the error shown in Figure 1 will appear.
Figure 1
3. Be sure to install Pkgconfig first and rely on it when installing other software
Second, install Gmetad from the source code
Need Libconfuse, Pkgconfig, PCRE, Apr,expat,rrdtool software dependent. When installing Gmond libconfuse, Pkgconfig, PCRE, apr,expat These software dependencies are already installed, now only need to install RRDtool this software relies on.
Next, we'll show you how to install RRDtool.
2.1. Software dependencies
Expat,python,libxml2,pixman,libpng,harfbuzz,zlib,libffi,glib,freetype,fontconfig,cairo,pango
2.2. Specific software version
Expat-2.1.0,python-3.5.0,libxml2-2.9.0,pixman-0.32.6,libpng-1.6.18,harfbuzz-1.0.0,zlib-1.2.8,libffi-3.2.1,glib-2.34.2,fre etype-2.6,fontconfig-2.11.94,cairo-1.14.2,pango-1.30.1,rrdtool-1.4.5
2.3. Installation Script
#!/bin/bash installdir= "/home/dsl/bigdisk/testdisk/usr/local" prefix= $INSTALLDIR exec_prefix= $INSTALLDIR oldincludedir= $INSTALLDIR/oldinclude dependency_path= $INSTALLDIR/lib/pkgconfig path= $PATH: $INSTALLDIR/bin #
Install expat CD expat-2.1.0/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir
Make make install echo "Finish installing Expat" CD. #install python cd Python-3.5.0./configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir make make and install echo "Finish installing Python" CD. #install libxml2 cd libxml2-2.9.0/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir make make install echo "Finish installing LIBXML2" CD. #install Pixman cd pixman-0.32.6/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir make make install echo "Finish installing Pixman" CD. #install libpng cd libpng-1.6.18/configure--prefix= $prefix--exec-prefix= $exeC_prefix--oldincludedir= $oldincludedir make do install echo "Finish installing Libpng" CD. #install harfbuzz cd harfbuzz-1.0.0/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir pkg_config_path= $dependency _path make do install echo "Finish installing Harfbuzz" CD. #install zlib cd zlib-1.2.8/configure--prefix= $prefix--eprefix= $exec _prefix make make install echo "Finish installing
Zlib "CD. #install libffi cd libffi-3.2.1/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir pkg_config_path= $dependency _path make do install echo "Finish installing Libffi" CD. #install glib CD glib-2.34.2/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir
Pkg_config_path= $dependency _path make do install echo "Finish installing glib" CD. #install freetype cd freetype-2.6/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$ Oldincludedir Pkg_config_path= $dependency _path--without-harfbuzz make do install echo "Finish installing FreeType" CD. #install fontconfig cd fontconfig-2.11.94/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$
Oldincludedir pkg_config_path= $dependency _path make do install echo "Finish installing Fontconfig" CD. #install Cairo CD cairo-1.14.2/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir
Pkg_config_path= $dependency _path make do install echo "Finish installing Cairo" CD. #install Pango cd pango-1.30.1/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir
Pkg_config_path= $dependency _path make do install echo "Finish installing Pango" CD. #install rrdtool cd rrdtool-1.4.5/configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir=$ Oldincludedir pkg_config_path= $dependency _path make do install echo "Finish installing RRDtool" CD.
2.4. Precautions
1, FreeType dependent Zlib,libpng,harfbuzz, need to specify Pkg_config_path variable
2, FreeType relies on harfbuzz, and Harfbuzz relies on freetype, so when compiling and installing FreeType, you need to specify "--without-harfbuzz" (The currently installed Harfbuzz is installed before FreeType and is incomplete), otherwise the error shown in Figure 2 appears.
Figure 2
The last script to install Gmetad is as follows:
#!/bin/bash installdir= "/home/dsl/bigdisk/testdisk/usr/local" prefix= $INSTALLDIR exec_prefix=$ INSTALLDIR oldincludedir= $INSTALLDIR/oldinclude dependency_path= $INSTALLDIR/lib/pkgconfig cd ganglia-3.7.2. Configure--prefix= $prefix--exec-prefix= $exec _prefix--oldincludedir= $oldincludedir pkg_config_path= $dependency _ Path cflags= "-i$installdir/include" ldflags= "-l$installdir/lib"--with-gmetad make make install CD:
When compiling and installing ganglia, add the "--with-gmetad" parameter, which means compile and install Gmond and Gmetad, otherwise it will only compile the installation gmond.
Third, install Gweb from the source code
First build the "Apache httpd + php + php-json" environment, assuming that "PHP + Php-json" has been pre-installed by the apt-get mechanism, referring to the "install Apache httpd from the source code, and load support for PHP," You can install Apache httpd from source code and configure Apache httpd to support PHP.
Then configure the value of the variable in the makefile file under Ganglia-web, then execute the "make install" command in Ganglia-web and copy the contents of the Ganglia-web to the Apache Web project directory, note that Also modify the $conf[' rrdtool ' variable value of the conf_default.php file in the Ganglia-web content that is copied to the Web project directory, so that the value is the RRDtool path that was last installed in the RRDtool process above the installation. This completes the construction of Gweb. The above can be referred to "monitoring with Ganglia" Chapter 2 Installing and configuring Ganglia ",
Note: In the above practice, with the root user to run the installation of the software, if you want to run as a normal user, refer to the "Run ganglia monitoring framework with ordinary users."
Reference documents:
[1]http://blog.csdn.net/dslztx/article/details/49097977
[2]https://bugs.freedesktop.org/show_bug.cgi?id=75652
[3]http://download.csdn.net/detail/dslztx/9178741
[4]http://download.csdn.net/detail/dslztx/9178745
[5]http://download.csdn.net/detail/dslztx/9178749
[6]http://download.csdn.net/detail/dslztx/9178753