集群分组部署ganglia监控服务

来源:互联网 发布:mysql设置不区分大小写 编辑:程序博客网 时间:2024/06/04 19:24

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


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

配置安装源

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm --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:8649data_source "BDC_Collector" bdc100:8646data_source "BDC_HBase" bdc110:8647data_source "BDC_ES" bdc211:8645data_source "BDC_LoadBalance" 10.4.23.211:8644data_source "BDC_OPC" 10.4.22.237:8648gridname "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 restartservice httpd restartservice gmetad restartchkconfig gmond onchkconfig --list gmondchkconfig httpd onchkconfig --list httpdchkconfig gmetad onchkconfig --list gmetad

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

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

一致

重启并设置服务自启动

service gmond restartchkconfig gmond onchkconfig --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 0
原创粉丝点击