Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation tutorial for Ganglia

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "Ganglia installation tutorial". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Ganglia is an open source monitoring project sponsored by UC Berkeley and designed to measure thousands of nodes. Each computer runs a daemon called gmond that collects and sends metrics such as processor speed, memory usage, and so on. It will be collected from the operating system and specified hosts. The host receiving all the metric data can display it and can pass a condensed form of it into the hierarchy. Because of this hierarchical pattern, Ganglia scales well. Gmond imposes very little system load, which makes it a piece of code that runs on each machine in the cluster without affecting user performance.

I. Ganglia component

Ganglia monitoring suite consists of three main parts: gmond, gmeta, and web interface, commonly referred to as ganglia-web.

Gmond : is a daemon that runs on every node that needs to be monitored, collects monitoring statistics, sends and receives statistics on the same multicast or unicast channel. If it is a sender (mute=no), it collects basic metrics such as system load (load_one),CPU utilization. It also sends metrics that users can customize by adding C/Python modules. If it is a receiver (deaf=no) it aggregates all metrics sent from other hosts and stores them in a memory buffer.

Gmetad: is also a daemon that periodically checks gmonds, pulls data from there, and stores their metrics in the RRD storage engine. He can query multiple clusters and aggregate metrics. It is also used to generate the web front end of the user interface.

Ganglia-web : As its name suggests, it should be installed on machines with gmeta running in order to read RRD files. Clusters are logical groupings of hosts and metrics data, such as database servers, web servers, production, testing, QA, etc., which are all completely separate and you need to run separate instances of gmond for each cluster.

In general, each node in the cluster needs a receiving gmond, and each site needs a gmeta.

II. Installation Dependency

Note: Superuser installation is recommended

1.# yum install -y gcc gcc-c++ libpng freetype zlib libdbi apr* libxml2-devel pkg-config glib pixman pango pango-devel freetye-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel pcre* rrdtool*

III. Installing expat dependencies

1.# cd /root

2.# wget http://jaist.dl.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz

3.# tar -xf expat-2.1.0.tar.gz && cd expat-2.1.0 && ./ configure --prefix=/usr/local/expat && make && make install && cd ..

For 64-bit operating systems, you need to manually copy the DLL to lib64.

1.# mkdir /usr/local/expat/lib64 && cp -a /usr/local/expat/lib/* /usr/local/expat/lib64/

IV. Installation of confusion

1.# wget http://ftp.twaren.net/Unix/NonGNU//confuse/confuse-2.7.tar.gz

2.# tar -xf confuse-2.7.tar.gz && cd confuse-2.7 && ./ configure CFLAGS=-fPIC --disable-nls --prefix=/usr/local/confuse && make && make install && cd ..

64bit machines need to copy dynamic link libraries:

1.# mkdir -p /usr/local/confuse/lib64 && cp -a -f /usr/local/confuse/lib/* /usr/local/confuse/lib64/

V. Installation of ganglia

1.# wget http://jaist.dl.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz

2.# tar -xf ganglia-3.6.0.tar.gz && cd ganglia-3.6.0 && ./ configure --with-gmetad --enable-gexec --with-libconfuse=/usr/local/confuse --with-libexpat=/usr/local/expat --prefix=/usr/local/ganglia --sysconfdir=/etc/ganglia && make && make install && cd ..

VI. Server configuration

Create the rrdtool data directory, see the gmeta_root variable in $ganglia-3.2.0/web/conf.php, and create permissions based on the user who runs apache, for example apache runs on apache.

1.# mkdir -p /var/lib/ganglia/rrds && mkdir -p /var/lib/ganglia/dwoo && chown -R root:root /var/lib/ganglia

Configure a data source, modify the/etc/ganglia/gmetad.conf file, and set the running user to the directory permission user of rrdtool, such as apache user

1.data_source "Hadoop" 192.168.1.108:8649

2.setuid_username "root"

Note: " hadoop " here represents the name of the cluster, followed by the host information contained in this cluster, that is, the host ip to be monitored.

Add self-startup script

1.# cp -f ganglia-3.6.0/gmetad/gmetad.init /etc/init.d/gmetad && cp -f /usr/local/ganglia/sbin/gmetad /usr/sbin/gmetad && chkconfig --add gmetad

Start gmeta service

1.# service gmetad start

Seeing Starting GANLIA gmetad: [ OK ] means that it is working properly. Verify that gmeta is OK via telnet localhost 8651

VII. Client configuration (gmond node)

The machine is installed as follows:

1.# cp -f ganglia-3.6.0/gmond/gmond.init /etc/init.d/gmond && cp -f /usr/local/ganglia/sbin/gmond /usr/sbin/gmond && chkconfig --add gmond && gmond --default_config > /etc/ganglia/gmond.conf

The generated default configuration file/etc/ganglia/gmond.conf needs to be modified appropriately

globals {

user = root /* User running Ganglia */

host_dmax = 120 /*secs */

send_metadata_interval = 15 /* Time interval for sending data */

}

cluster {

name = "hadoop" /* Cluster name */

owner = "root" /* User running Ganglia */

}

udp_send_channel {

# mcast_join = 239.2.11.71 comment out multicast */

host = 192.168.1.108/* sent to machines where gmeta is installed */

}

udp_recv_channel { #Accepts UDP packet configuration

# mcast_join = 239.2.11.71

# bind = 239.2.11.71

}

where name is the grouping to be done on the server side and is the data source on the server side. Next, open the service.

1.# service gmond start

See Starting GANLIA gmetad: [ OK ] for successful startup. If there is a failure, you can change debug from 0 to 100 in gmund.conf, look at more logs, and then troubleshoot.

VIII. Web configuration of the server

PHP programs depend on Apache to run, so install the following dependencies

1.# yum -y install php httpd

2.# service httpd start //Start httpd service

IX. Test whether the installation is successful

1.# vi /var/www/html/index.php

Input:

Save and then browser master/index.php

Normal is to see PHP information.

1.# cd /root

2.# wget http://jaist.dl.sourceforge.net/project/ganglia/ganglia-web/3.5.10/ganglia-web-3.5.10.tar.gz

3.# tar -xf ganglia-web-3.5.10.tar.gz && cd ganglia-web-3.5.10 && make install && cd ..

The requested URL/html/index.php was not found on this server.

Note:

Ganglia access failed:

There was an error collecting ganglia data (127.0.0.1:8652): fsockopen error: Permission denied

Solution:

You need to close selinux: vi /etc/selinux/config, change SELINUX=enforcing to SELINUX=disable; you need to restart the machine.

Selinux can be turned off without a restart using the command setenforce 0, which can be accessed by refreshing the page. But this method is only a stopgap measure. To permanently modify selinux settings, use the first method.

Restart httpd server to see the effect

1.# service httpd restart

Use http://master/ganglia to view ganglia information. (Note: master is the hostname of the host running gmeta)

"Ganglia installation tutorial" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report