In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to use Ganglia to monitor Linux grid and cluster servers in real time". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Tools such as application monitoring have been a good helper for system administrators since they took over server and host management. The more famous ones are Nagios, Zabbix, Icinga and Centreon. These are heavyweight monitoring tools, and it is difficult for a novice administrator to set them up and use the advanced features.
This article will introduce you to Ganglia, which is an easy-to-extend monitoring system. Use it to view the performance metrics in Linux servers and clusters (graphical presentation) in real time.
Ganglia allows you to better organize servers by cluster (by server group) and grid (by geographic location).
In this way, we can create a grid containing all the remote hosts, and then divide those machines into small collections according to other criteria.
In addition, Ganglia's web page is optimized for mobile devices and allows you to export data in csv and .json formats.
Our test environment includes a master node server CentOS 7 (IP address 192.168.0.29) with Ganglia installed, and a Ubuntu 14.04 host (192.168.0.32) as the monitored side. We will monitor this Ubuntu host through the Web page of Ganglia.
The following example can be used for reference, with CentOS7 as the master node and Ubuntu as the monitored object.
Install and configure Ganglia
Follow these steps to install monitoring tools on the primary node server.
1. Enable the EPEL repository, and then install Ganglia and related tools:
# yum update & & yum install epel-release # yum install ganglia rrdtool ganglia-gmetad ganglia-gmond ganglia-web
In this step above, along with Ganglia, you will install some applications with the following functions:
Rrdtool,Round-Robin database, which is a tool for storing and graphically displaying data that changes over time
Ganglia-gmetad is a daemon that collects data from monitored hosts. Both the monitored host and the master node host should install Ganglia-gmond (monitoring the daemon itself)
Ganglia-web provides a Web front end for displaying historical data and graphics of the monitoring system.
2. Use the basic authentication function provided by Apache to configure authentication for the Ganglia Web interface (/ usr/share/ganglia).
If you want to learn more about advanced security mechanisms, please refer to the authorization and authentication section of the Apache documentation.
To accomplish this, we need to create a user name and set a password to access resources protected by Apache. In this case, we first create a user name called adminganglia, then assign it a password, which will be stored in / etc/httpd/auth.basic (you can choose another directory and / or file name at will, as long as Apache has read access to it.)
# htpasswd-c / etc/httpd/auth.basic adminganglia
Enter the password to adminganglia twice to complete the password setting.
3. Modify the configuration file / etc/httpd/conf.d/ganglia.conf:
Alias / ganglia / usr/share/ganglia AuthType basic AuthName "Ganglia web UI" AuthBasicProvider file AuthUserFile "/ etc/httpd/auth.basic" Require user adminganglia
4. Edit / etc/ganglia/gmetad.conf:
First, use the gridname directive to set a descriptive name for the grid.
Gridname "Home office"
Then, use the data_source directive, followed by the cluster name (server group), the polling interval (seconds), and the IP address of the host of the primary node and the monitored node:
Data_source "Labs" 60 192.168.0.29 data_source 8649 # Master node data_source "Labs" 60 192.168.0.32 # monitored node
5. Edit / etc/ganglia/gmond.conf.
A) make sure the configuration of the cluster is similar to the following.
The name of the data_source instruction in cluster {name = "Labs" # gmetad.conf owner = "unspecified" latlong = "unspecified" url = "unspecified"}
B) in udp_send_chanel, comment out mcast_join:
Udp_send_channel {# mcast_join = 239.2.11.71 host = localhost port = 8649 ttl = 1}
C) in udp_recv_channel, comment out the mcast_join and bind sections:
Udp_recv_channel {# mcast_join = 239.2.11.71 # # comment out port = 8649 # bind = 239.2.11.71 # # comment out}
Save and exit.
6. Open the 8649/udp port and use SELinux to ensure that the php script (run through Apache) can connect to the network:
# firewall-cmd-add-port=8649/udp # firewall-cmd-add-port=8649/udp-permanent # setsebool-P httpd_can_network_connect 1
7. Restart Apache, gmetad, gmond, and make sure they are enabled for boot.
# systemctl restart httpd gmetad gmond # systemctl enable httpd gmetad httpd
At this point, we can now open the Web page of Ganglia, http://192.168.0.29/ganglia, and log in with the credentials set in step 2.
[] [5]
Gangila Web page
8. On the Ubuntu host, you only need to install Ganglia-monitor, which is equivalent to ganglia-gmond on CentOS:
$sudo aptitude update & & aptitude install ganglia-monitor
9. Edit the / etc/ganglia/gmond.conf file of the monitored host. The file is the same as on the host of the master node, except for the commented out cluster, udp_send_channel, udp_recv_channel, which should not be commented here:
Cluster {name = "Labs" # The name in the data_source directive in gmetad.conf owner = "unspecified" latlong = "unspecified" url = "unspecified"} udp_send_channel {mcast_join = 239.2.11.71 host = localhost port = 8649 ttl = 1} udp_recv_channel {mcast_join = 239.2.11.71 # # comment out port = 8649 bind = 239.2.11.71 # comment out}
Then restart the service.
$sudo service ganglia-monitor restart
10. Refresh the page, and you will see various statistics and graphical display of the two hosts in Home office grid / Labs cluster (use the drop-down menu to select the cluster, in this case, Labs):
Home office Grid report in Ganglia
Using the menu button (as noted above), you can get information about each server and cluster. You can also use the compare hosts Compare Hosts tab to compare the status of all servers in the cluster.
You can use regular expressions to select a set of servers, and you can immediately see a comparison of their performance:
Ganglia server information
One of my favorite features is a friendly summary interface for mobile, which can be accessed through the Mobile option. Select the cluster you are interested in, and then select a host.
Summary screenshot of Ganglia mobile terminal
This is the end of the content of "how to use Ganglia to monitor Linux grid and cluster servers in real time". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.