The deployment of cluster monitoring software Ganglia on Ubuntu Server

 Ganglia will be installed again, this time Ubuntu. I searched some posts on the installation of Ganglia on Ubuntu and found that there are many inapplicable places, especially for the latest version of Ganglia 3.1.7.

For the basic principle and structure diagram of ganglia monitoring, please refer to this post, the picture is in place:
http://www.javabloger.com/article/j2ee-linux-ganglia-rrdtool-java-mysql-1.html

The following describes the installation process , Using the latest version of rrdtool and ganglia. First, download the latest source code of rrdtool and ganglia, make sure all machines have gcc, and can be updated with apt-get.

The server server is the monitoring node, installs gmetad, rrdtool, apache, etc., and is responsible for collecting data of each cluster node.
The client is the monitored node, and gmond needs to be installed. Gmond monitors the machine status and uploads it to gmetad.

1. Server installation and configuration:

log in to the machine

sudo apt-get install libapr1-dev libconfuse-dev libexpat-dev libpcre3-dev //Note that these are for reference only. If the package is missing, it will be prompted during configure, and you can install it later . The specific version is available * after matching, you can choose any one to install
sudo apt-get install chkconfig or sysv-rc-conf
sudo apt-get install daemon //This is very important, the new version of the startup script uses a daemon, but not in ubuntu

a. Install rrdtool
tar zxvf rrdtool-1.4.4.tar.gz
cd rrdtool-1.4.4
./configure //At this time, it will prompt that libart, freetype, libpng and other packages are missing. apt-get installation can
make
sudo make install

b. install gmetad
tar zxvf ganglia-3.1.17.tar.gz
cd ganglia-3.1.17
./configure CFLAGS="-I/usr/local/rrdtool-1.4.4/ include" CPPFLAGS="-I/usr/local/rrdtool-1.4.4/include" LDFLAGS="-L/usr/local/rrdtool-1.4.4/lib" --with-gmetad --enable-gexec - sysconfdir=/etc/ganglia //#gmetad will be installed only when --with-metad is added. This will install both gmetad and gmond
make
sudo make install
sudo mkdir /etc/ganglia
sudo cp ~/ganglia-3.1.17/gmetad/gmetad.conf /etc/ganglia/gmetad.conf
sudo vi /etc/ganglia/gmetad.conf //Change the cluster name and owner. Set setuid_username to the current user name. This setting can be done in accordance with other posts
vi ~/ganglia-3.1.17/gmetad/gmetad.init //There is a line /etc/rc.d/init.d/functions which is not available in ubuntu and needs to be changed to / lib/lsb/init-fuctions.
sudo cp ~/ganglia-3.1.17/gmetad/gmetad.init /etc/init.d/gmetad
chkconfig gmetad on or sysv-rc-conf gmetad on //Check service
sudo service gmetad start // start the service

c.web front-end
premise is installed apache, if it is not installed
sudo cp -a ~ / Ganglia-3.1.17 / the WWW / var / the WWW
sudo mv / var / the WWW / the WWW / var / the WWW / Ganglia / / name change under the
browser to log http: // yourserverip / ganglia Client node at this time has not yet come in plus


installation and configuration of 2.Client:

Log machine
sudo apt-get install libapr1-dev libconfuse-dev libexpat-dev libpcre3-dev
sudo apt-get install chkconfig or sysv-rc-conf
sudo apt-get install daemon
tar zxvf ganglia-3.1.17.tar.gz
cd ganglia-3.1.17
----Note that if the server is also a client, you need to follow the following again configure, make, make install----
./configure --sysconfdir=/etc/ganglia //If this option is not added, you will be prompted to add it at the end, in order not to waste time, just add it for the first time
make
sudo make install
sudo mkdir /etc/ganglia //We put the configuration file in /etc/ganglia, so we must first create the corresponding directory
sudo touch /etc/ganglia/gmond.conf
sudo chmod 666 /etc/ganglia/gmond.conf 
sudo gmond -t> /etc/ganglia/gmond.conf
sudo vi /etc/gmond.conf //Fill in the same cluster name as Server, and the owner can be
vi ~/ganglia-3.1.17/gmond/gmond.init //where There is a line /etc/rc.d/init.d/functions which is not available in ubuntu and needs to be changed to /lib/lsb/init-fuctions.
sudo cp ~/ganglia-3.1.17/gmond/gmond.init /etc/init.d/gmond //Otherwise, gmond service cannot be found.
chkconfig gmond on or sysv-rc-conf gmond on
when sudo mkdir / var / lock / subsys // start creates lock files to this directory, ubuntu or not
sudo service gmond start // start the service
at this time to refresh the browser, see One more machine. You can continue to install the next Client.

Guess you like

Origin blog.csdn.net/panpanloveruth/article/details/6972954