集群分组部署ganglia监控服务

集群分组部署ganglia监控服务,ganglia是常用的集群监控软件,默认为不分组的,即所有的机器都放在一个组里。


1、服务端服务器安装与配置

配置安装源

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

安装ganglia服务端相关的组件

yum install ganglia ganglia-devel ganglia-gmetad ganglia-gmond ganglia-web ganglia-gmond-python

配置收集的配置文件

vim /etc/ganglia/gmetad.conf

其实Ganglia的分组很简单,就是分端口,不同的组配置不同的监听端口就完事了。

data_source "BDC_Hadoop" 10.4.22.121:8649
data_source "BDC_Collector" bdc100:8646
data_source "BDC_HBase" bdc110:8647
data_source "BDC_ES" bdc211:8645
data_source "BDC_LoadBalance" 10.4.23.211:8644
data_source "BDC_OPC" 10.4.22.237:8648

gridname "BDC"

数据来源有6个,这6个分别是每个组的组长,相当于一道杠。但是组长是不需要配置gmetad的,除非你要做多级组播收集数据。每个组长只需要分配不同的端口号就可以了。你可能会问,IP不一样,端口一样不行吗?不行,因为这个IP是单播IP,相当于一个路由指向,而Ganglia实际的数据传输是在多播IP上进行的,而多播IP只有一个。在客户端配置,如果你需要多级gmetad,可以配多个多播IP。


配置客户端文件

vim /etc/ganglia/gmond.conf

cluster {
  name = "BDC_OPC"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}

/* The host section describes attributes of the host, like the location */
host {
  location = "unspecified"
}

/* Feel free to specify as many udp_send_channels as you like.  Gmond
   used to only support having a single channel */
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
  port = 8648
  ttl = 1
}

/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
  mcast_join = 239.2.11.71
  port = 8648
  bind = 239.2.11.71
  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
}

/* You can specify as many tcp_accept_channels as you like to share
   an xml description of the state of the cluster */
tcp_accept_channel {
  port = 8648
  # If you want to gzip XML output
  gzip_output = no
}

修改cluster的name,及Portal小组的端口,从gmetad.conf中可以看到,Portal小组属于8648端口,那么相应的在gmond中,也要将udp和tcp端口写为8648。


httpd的配置

vim   /etc/httpd/conf.d/ganglia.conf

#
# Ganglia monitoring system php web frontend
#

Alias /ganglia /usr/share/ganglia

<Location /ganglia>
  Order deny,allow
  Allow from all
  #Allow from 127.0.0.1
  #Allow from ::1
  # Allow from .example.com
</Location>

重启服务并设置随系统自动启动

service gmond restart
service httpd restart
service gmetad restart


chkconfig gmond on
chkconfig --list gmond
chkconfig httpd on
chkconfig --list httpd
chkconfig gmetad on
chkconfig --list gmetad

2、客户端服务器安装与配置

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum install ganglia ganglia-gmond
配置与服务端的
vim /etc/ganglia/gmond.conf

一致

重启并设置服务自启动

service gmond restart

chkconfig gmond on
chkconfig --list gmond

3、注意关闭服务端的selinux

vim /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
重启系统完成


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值