当前位置: 首页 > 工具软件 > Ganglia > 使用案例 >

Ganglia安装部署流程

毛德华
2023-12-01

Ganglia安装部署过程

ganglia由分三个部分组成gmond,gmetad、gweb。

  • gmond负责采集数据(需要进行监测的节点都要安装)
  • gmetad负责接收gmond收集的数据(只需要在部署Web服务的节点安装)
  • gweb负责展现gmetad的数据(只需要在部署Web服务的节点安装)

第一步 安装文件

  1. 安装epel源,安装命令如下(所有节点都安装)
yum -y install epel-release
  1. 安装gmond(采集数据的节点安装)
yum -y install ganglia-gmond
  1. 下载gmetad(Web服务节点安装)
yum -y install ganglia-gmetad
  1. 下载 gweb(Web服务节点安装)
sudo yum -y install httpd php # 需要额外安装httpd、php
sudo yum -y install ganglia-web

第二步 配置文件

  1. 修改配置文件vim /etc/httpd/conf.d/ganglia.conf
 # Ganglia monitoring system php web frontend
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
 Require all granted
 #Order deny,allow
 #Deny from all
 #Allow from all
 # Allow from 127.0.0.1
 # Allow from ::1
 # Allow from .example.com
</Location>

  1. 修改配置文件/etc/ganglia/gmetad.conf
data_source “hadoop202” 192.168.88.202
  1. 修改配置文件/etc/ganglia/gmond.conf【这里一个节点配置完,通过scp同步所有节点】(注意:重点关注name,bind以及host的配置信息)
[atguigu@hadoop102 flume]$ sudo vim /etc/ganglia/gmond.conf 
修改为:
cluster {
 name = "hadoop202"  ###名字要和gmetad中的相同
 owner = "unspecified"
 latlong = "unspecified"
 url = "unspecified"
}
udp_send_channel {
 #bind_hostname = yes # Highly recommended, soon to be default.
 # This option tells gmond to use a source address
 # that resolves to the machine's hostname. Without
 # this, the metrics may appear to come from any
 # interface and the DNS names associated with
 # those IPs will be used to create the RRDs.
 # mcast_join = 239.2.11.71
 host = 192.168.88.202 ###接收数据的节点IP地址
 port = 8649
 ttl = 1
}
udp_recv_channel {
 # mcast_join = 239.2.11.71
 port = 8649
 bind = 192.168.88.202 ###节点本机的IP地址
 retry_bind = true
 # Size of the UDP buffer. If you are handling lots of metrics you really
 # should bump it up to e.g. 10MB or even higher.
 # buffer = 10485760
}

  1. 修改配置文件/etc/selinux/config【注意:需要重启后才生效】
SELINUX=disabled # 解决冲突

第三步 启动Ganglia

systemctl start httpd.service
systemctl start gmetad.service
systemctl start gmond.service

权限问题

  1. 关闭防火墙
systemctl stop firewalld
  1. 授权
chmod -R 777 /var/lib/ganglia
 类似资料: