Environment:
Centos6.5x64, cdh5.1.0
Three nodes:
C1:gmeta Gmond (Gmeta similar to namenode,gmond equivalent to Datanode) master node
C2:gmond (equivalent to Datanode)
C3:gmond (equivalent to Datanode)
A. Ganglia Introduction
Ganglia is an open source cluster monitoring project initiated by UC Berkeley, designed to measure thousands of nodes. The core of ganglia consists of Gmond, Gmetad, and a web front end. Mainly used to monitor the performance of the system, such as: CPU, MEM, hard disk utilization, I/O load, network traffic, etc., through the curve is easy to see the working state of each node, the rational adjustment, distribution system resources, improve the overall performance of the system play an important role. (from Baidu Encyclopedia)
Two Installation of pre-work Epel
EPEL (Extra Packages for Enterprise Linux), which is a software repository designed for Rhel, has a lot of free common software in this warehouse, maintained by the Fedora Project, and if you use Rhel,centos, Scientific and other Rhel series of Linux, can be very convenient to use the Epel yum source.
See if Epel is installed on this machine:
Rpm-q Epel-release
Package epel-release are not installed
If it is not installed, you can choose the following conditions to install:
64-bit System selection:
wget HTTP://DOWNLOAD.FEDORAPROJECT.ORG/PUB/EPEL/6/X86_64/EPEL-RELEASE-6-8.NOARCH.RPMRPM-IVH epel-release-6-8.noarch.rpm
Import Key: (This step can be ignored)
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
After installation can be viewed, get:
Rpm-q Epel-release
Epel-release-6-8.noarch
Three Installation of Ganglia
There are currently three nodes in the cluster: C1, C2, C3, where C1 is the primary node
1. Server-side Installation
Installation required in the server
sudo yum-y install ganglia ganglia-devel Ganglia-gmetad ganglia-gmond ganglia-web Ganglia-gmond-python
2. Client Installation
Installation required in the client
sudo yum-y install ganglia Ganglia-gmond
Four. Configuration of the Ganglia
1. Server-side configuration
sudo vim/etc/ganglia/gmetad.conf
data_source "My_cluster" Datanode1 datanode2 datanode3
Just change the Data_source line, "My_cluster" represents the name of the cluster, DATANODE1,DATANODE2DATANODE3, is the list of machines to monitor. Default Port 8649. Setuid_username "Apache" (Can not be set)
2. Client Configuration
sudo vim/etc/ganglia/gmond.conf
Set the name in the cluster option to data_source specified in Gmetad ("My_cluster"). Such as:
Cluster {
Name = "My_cluster"
Owner = "Unspecified"
Latlong = "Unspecified"
url = "Unspecified"
}
Where name needs to match "Shaqi" in Data_source in gmetad.conf
Owner needs to correspond to the values in the Setuid_username (if not set, it can not be modified)
You need to make changes to the permissions after you modify the Setuid_username:
Chown-r Apache:apache/var/lib/ganglia/rrds
Otherwise, the service Gmetad status appears Gmetad dead but Subsys locked
Service-side configuration for 3.Apache
Vim/etc/httpd/conf.d/ganglia.conf
The code is as follows:
Alias/ganglia/usr/share/ganglia
<Location/ganglia>
Order Deny,allow
Allow from all
</Location>
V. Disable SELinux on the server (otherwise you will not be able to access the Web page)
Vim/etc/selinux/config
selinux=enforcing//change to disable
Restarting the machine
You can use the command Setenforce0 to close SELinux without restarting and refreshing the page to access it.
Six Ganglia Start-up
Service-side startup:
Service Gmetad Start
Each node starts:
Service Gmond Start
Launch Apache Web service: (Master node)
Service httpd Start
Seven
.
Test
A Open your browser: Http://serverip/ganglia .
6.2 enter the following command on the server to determine Gmond whether the work is normal:
#telnet node18649
#telnet node28649
#telnet node38649
Press two times to enter, your screen should now show a long list of include Gmond The performance metrics of the monitoring XML
Ganglia Installing for centos6.5