ganglia监控物理机

分布式监控 工具Ganglia介绍与集群部署

使用Ganglia来监控物理机

Ganglia的监控包括gmond、gmetad以及一个web前端。

gmond(GangliaMonitoring Deamon)是一种轻量级服务,安装在每台需要收集指标数据的节点主机上,gmond在每台主机上完成实际意义上的指标数据收集工作,并通过侦听/通告协议和集群内其他节点共享数据。使用gmond,你可以很容易收集很多系统指标数据,如CPU、内存、磁盘、网络和活跃进程的数据等。

gmetad(GangliaMeta Daemon)是一种从其他gmetad或gmond源收集指标数据,并将其以RRD格式存储至磁盘的服务。gmetad为从主机组收集的特定指标信息提供了简单的查询机制,并支持分级授权,使得创建联合监测域成为可能。
gweb(GangliaWeb)是一种利用浏览器显示gmetad所存储数据的PHP前端。在Web界面中以图表方式展现集群的多种不同指标数据。

 

本人使用的操作系统是Ubuntu14.04

安装

master端:

sudo apt-get install ganglia-monitor rrdtoolgmetad ganglia-webfrontend

 

cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf

 

slave端

sudo apt-get install ganglia-monitor

 

 

修改配置

 
sudo vi /etc/ganglia/gmetad.conf

 

更改内容为:

data_source "my cluster" localhost

修改为:

data-source标识一个要监控的集群

格式为:data_source “my cluster” [polling interval] address1:port address2:port address3:port …………..

一般情况下默认端口port8649

 

sudo vi /etc/ganglia/gmond.conf

 

修改内容:

/* If a cluster attribute is specified, then all gmond hosts are wrapped inside
    * of a tag. If you do not specify a cluster tag, then all will
    * NOT be wrapped inside of a tag. */
    cluster {
    name = "unspecified"
    owner = "unspecified"
    latlong = "unspecified"
    url = "unspecified"
    }

 

修改为:

cluster {
name = "my cluster"
owner = "unspecified"
latlong = "unspecified"
url = "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 {
    mcast_join = 239.2.11.71
    port = 8649
    ttl = 1
    }

修改为:

//修改为:
    /* Feel free to specify as many udp_send_channels as you like. Gmond
    used to only support having a single channel */
udp_send_channel {
#mcast_join = 239.2.11.71
    host = 192.168.56.10   hostmaster主机的ip地址
    port = 8649
    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 = 8649
    bind = 239.2.11.71
    }

 

修改为:

/* You can specify as many udp_recv_channels as you like as well. */
    udp_recv_channel {
    #mcast_join = 239.2.11.71
    port = 8649
    #bind = 239.2.11.71
    }

 

验证是否工作

telnetlocalhost 8649

通过对端口的监听获取xml数据观察,ganglia是否处于工作状态

 

重启服务

sudo/etc/init.d/ganglia-monitor start
sudo/etc/init.d/gmetad start
sudo/etc/init.d/apache2 restart

 

 

slave端的操作

sudo apt-get install ganglia-monitor

 

修改文件:

sudo vi /etc/ganglia/gmond.conf

 

修改信息同上

 

启动服务;

sudo/etc/init.d/ganglia-monitor start

 

 

配置完成

访问页面:localhost/ganglia

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章