Showing posts with label ganglia. Show all posts
Showing posts with label ganglia. Show all posts

Friday, July 30, 2010

Compiling Ganglia - Errors and problems

Some errors and problems:


My install directory was /opt/ganglia.


Error -
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Solution -
Add gcc bin path to PATH environment variable



Error -
checking for pcre.h... no
checking for pcre_compile in -lpcre... no
libpcre not found, specify --with-libpcre=no to build without PCRE support

Solution -
PCRE is not installed.
# wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/pcre-8.10.tar.gz
# /usr/local/bin/tar -xzf pcre-8.10.tar.gz
# cd pcre-8.10
# ./configure --prefix=/opt/ganglia
# make && make install

Make sure you add, -I/opt/ganglia/include to CFLAGS environment variable
and -L/opt/ganglia/lib to LDFLAGS after this.



Problem -
Graphs not shown in ganglia or images not shown on ganglia front end.


Reason -
php-gd may not have been installed.
You can do so by ( as root) -
# yum install php-gd
Another reason could be front-end can't find RRD path. Make sure it is set in conf.php


Error -
checking for apr-1-config... no
configure: error: apr-1-config binary not found in path


Reason -
APR is not installed or path of apr-1-config is not available through the PATH environment variable.


Error -
libgcc_s.so.1: open failed: No such file or directory


Solution-
Execute the following:
# ldd gmond
...
libgcc_s.so.1 => (file not found)
...


So gmond can link to libgcc


Add the following to you LDFLAGS
# setenv LDFLAGS $LDFLAGS:-R/yourgccpath/gcc-4.0.3/lib


-R records the runtime search path.


Install again
# ./configure --prefix=/opt/ganglia --sysconfdir=/opt/ganglia/etc
# make && make install


Error -
After installation, while executing gmond
apr_pollset_create failed: Invalid argument

Solution -
In your config file gmond.conf, if there is no udp_recv_channel or tcp_accept_channel
defined, gmond fails to run with this error.
Set "deaf = yes " under "globals"

Error -
/usr/bin/ld: cannot find -lpython2.3
collect2: ld returned 1 exit status
make[4]: *** [modpython.la] Error 1

Solution -
I dont remember exactly how i resolved it.
Most likely it was the linker not being able to find python.
Probably by setting library flags this error was resolved.

Error -
false cru libgetopthelper.a getopt1.o getopt.o getopt_init.o
make[2]: *** [libgetopthelper.a] Error 1

Solution -
Add /usr/ccs/bin to PATH environment variable.

In case of dependency not found errors, you could configure options, like --with-libapr, --with-libconfuse to point to dependency paths.

Error -
Some gm_protocol_xdr.c related warnings and finally build fails with this error

ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status

Solution -
Uninstall the dependency 'confuse' and install it by setting CFLAGS="-O3 -fPIC"
> cd ../confuse-2.7/
> make uninstall
> make clean
> env CFLAGS="-O3 -fPIC" ./configure --prefix=/opt/ganglia
> make && make install

Do a configure, make and make install and you should be good.
 

Tuesday, July 27, 2010

Ganglia - Basic installation and configuration guide

After playing around, with both Zabbix and Ganglia, I decided to go ahead with Ganglia. The installation is tricky but once it is installed, configuring and adding hosts is easy. Here I will discuss, installation and configuration of Ganglia. Both the client and server daemon will be installed on the same machine.


Ganglia is a monitoring system for high-performance computing systems. Ganglia comprises of two daemons. The daemon gmond, acts like a client and sends machine information( as xml fomat), to daemon gmetad which stores these statistics in a round robin database.


A PHP-based web frontend is used to dispay the graphs in near real time.
Before starting Ganglia a few dependencies are required to be installed.

# tcsh
# setenv INSTALL_DIR /opt/rrdtool-1.4.4
# setenv BUILD_DIR /opt/build/rrdbuild
# cd $BUILD_DIR  
# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz 
# gunzip -c rrdtool-1.4.4.tar.gz | tar xf – # cd rrdtool-1.4.4
# ./configure --prefix=$INSTALL_DIR && make && make install
This would have installed round robin database. It is required only on the head node. The head node (server) would be the one where you want to install gmetad daemon.
Another dependency required for Ganglia is libconfuse.


# cd /opt/build
# wget http://bzero.se/confuse/confuse-2.6.tar.gz
# /bin/tar -xzf confuse-2.6.tar.gz
# cd confuse-2.6
# ./configure --prefix=/opt/ganglia
# env CFLAGS="-O3 -fPIC" ./configure --prefix=/opt/ganglia
# make
# make install


Now we download Ganglia source package and begin installation.

# cd /opt/build/ 
# wget http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.1.7/ganglia-3.1.7.tar.gz/download 
# tar -xzf ganglia-3.1.7.tar.gz 
# cd ganglia-3.1.7  
# setenv CFLAGS "-I/opt/ganglia/include/ -I/opt/rrdtool-1.4.4/include"  
# setenv LDFLAGS "-L/opt/ganglia/lib/ -L/opt/rrdtool-1.4.4/lib"  
# ./configure --prefix=/opt/ganglia --with-gmetad --sysconfdir=/etc/ganglia  
# make  
# make install
Make sure the permissions are appropriate on path /opt/ganglia/rrds. This is the path where I have my round robin database.
# cd /opt/ganglia/sbin/
# ./gmond --default-config > gmond.conf
# ./gmetad --default-config > gmetad.conf


Setup config files for gmetad and gmond.conf
# vi gmond.conf

Set up your udp_send_channel to look like this:
 udp_send_channel {
  host = masterhostname
  port = 8650
  ttl = 1
}

# vi gmetad.conf

Modify directives as:
data_source "MyCluster" localhost
rrd_rootdir "/opt/ganglia/rrds"
# cp gmond.conf /etc/ganglia/.
# cp gmetad.conf /etc/ganglia/.
# cd $BUILD_DIR
# cp gmond/gmond.init /etc/rc.d/init.d/gmond
# vi /etc/rc.d/init.d/gmond
Set this variable as
GMOND=/opt/ganglia/sbin/gmond


Optional (this would enable running the daemons as an automated service) :
# chkconfig --add gmond
# chkconfig --list gmond
gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# /etc/rc.d/init.d/gmond start
Starting GANGLIA gmond: [ OK ]
# cd /opt/build/ganglia-3.1.7/gmetad
# cp gmetad.init /etc/rc.d/init.d/gmetad
# vi /etc/rc.d/init.d/gmetad


GMETAD=/opt/ganglia/sbin/gmetad


# chkconfig --add gmetad
# chkconfig --list gmetad
gmetad 0:off 1:off 2:on 3:on 4:on 5:on 6:off


# /etc/rc.d/init.d/gmetad start
Starting GANGLIA gmetad: [ OK ]
Edit httpd.conf


Add the following lines if they are not a part of your config file.
LoadModule php5_module modules/libphp5.so

Edit DirectoryIndex like
DirectoryIndex index.html index.html.var index.php
Addtype application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Copy “web” folder to httpd document root location


Edit conf.php in web folder:
define("RRDTOOL", "/opt/rrdtool-1.4.4/bin/rrdtool");


RRDTOOL should point to rrdtool path


# /sbin/service httpd restart


You can point your browser to the web front end location and it should display you the graphs.