Ganglia 由 gmond、gmetad 和 gweb 三部分组成。

gmond(Ganglia Monitoring Daemon)是一种轻量级服务,安装在每台需要收集指标数据的节点主机上。使用 gmond,你可以很容易收集很多系统指标数据,如 CPU、内存、磁盘、网络和活跃进程的数据等。

gmetad(Ganglia Meta Daemon)整合所有信息,并将其以 RRD 格式存储至磁盘的服务。

gweb(Ganglia Web)Ganglia 可视化工具,gweb 是一种利用浏览器显示 gmetad 所存储数据的 PHP 前端。在 Web 界面中以图表方式展现集群的运行状态下收集的多种不同指标数据。

一、安装

# 替换阿里 yum 源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo # 安装 httpd 服务与 php
sudo yum -y install httpd php # 安装其他依赖
sudo yum -y install rrdtool perl-rrdtool rrdtool-devel
sudo yum -y install apr-devel # ganglia 在 epel 源中
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo # 安装 ganglia
sudo yum -y install ganglia-gmetad
sudo yum -y install ganglia-web
sudo yum -y install ganglia-gmond

二、配置

1.httpd 配置

https://blog.csdn.net/mxl00z/article/details/83041266

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

ganglia.conf

#
# Ganglia monitoring system php web frontend
# Alias /ganglia /usr/share/ganglia <Location /ganglia>
# Options Indexes FollowSymLinks
# AllowOverride None
Require all granted
# Order deny,allow
# Deny from all
# Allow from all
# Require local
# Require ip 10.1.2.3
# Require host example.org
</Location>

2.gmetad 配置

sudo vim /etc/ganglia/gmetad.conf

gmetad.conf

。。。。。。
# A list of machines which service the data source follows, in the
# format ip:port, or name:port. If a port is not specified then 8649
# (the default gmond port) is assumed.
# default: There is no default value
#
# data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655
# data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651
# data_source "another source" 1.3.4.7:8655 1.3.4.8 data_source "h136" 192.168.8.136 。。。。。。

3.gmond 配置

sudo vim /etc/ganglia/gmond.conf

gmond.conf

。。。。。。
/*
* The cluster attributes specified will be used as part of the <CLUSTER>
* tag that will wrap all hosts collected by this instance.
*/
cluster {
name = "h136"
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
host = 192.168.8.136
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 = 192.168.8.136
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
}
。。。。。。

4.selinux 配置

setenforce 

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

三、启动

systemctl restart httpd
systemctl restart gmetad
systemctl restart gmond

浏览器访问:http://IP/ganglia/

若出现 You don't have permission to access /ganglia/ on this server,可以修改/var/lib/ganglia 目录的权限。

sudo chmod -R  /var/lib/ganglia

四、操作 Flume 测试监控

修改 flume-env.sh,添加 JAVA_OPTS

vim /opt/apache-flume-1.9.-bin/conf/flume-env.sh

JAVA_OPTS="-Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=192.168.8.136:8649 -Xms100m -Xmx200m"

测试任务文件

flume-netcat-logger.conf

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1 # Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = 127.0.0.1
a1.sources.r1.port = 4444 # Describe the sink
a1.sinks.k1.type = logger # Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

启动 Flume 任务

cd /opt/apache-flume-1.9.-bin

bin/flume-ng agent --conf conf/ --name a1 --conf-file /tmp/flume-job/flume-netcat-logger.conf -Dflume.root.logger==INFO,console -Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=192.168.8.136:

nc 127.0.0.1 

查看 Ganglia

图例说明:

字段(图表名称) 字段含义
EventPutAttemptCount source 尝试写入 channel 的事件总数量
EventPutSuccessCount 成功写入 channel 且提交的事件总数量
EventTakeAttemptCount sink 尝试从 channel 拉取事件的总数量
EventTakeSuccessCount sink 成功读取的事件的总数量
StartTime channel 启动的时间(毫秒)
StopTime channel 停止的时间(毫秒)
ChannelSize 目前 channel 中事件的总数量
ChannelFillPercentage channel 占用百分比
ChannelCapacity channel 的容量

Flume-数据流监控 Ganglia的更多相关文章

  1. flume学习以及ganglia(若是要监控hive日志,hive存放在/tmp/hadoop/hive.log里,只要运行过hive就会有)

    python3.6hdfs的使用 https://blog.csdn.net/qq_29863961/article/details/80291654 https://pypi.org/  官网直接搜 ...

  2. Nagios监控ganglia的指标

    这是nagios与ganglia整合的一部分内容 . 通常我们会把ganglia的监控发送给一个主机,我们可以在这个主机上执行nc localhost 8649 可以获取到所有发往这个主机的信息,以x ...

  3. Hadoop YARN学习监控JVM和实时监控Ganglia、Ambari(5)

    Hadoop YARN学习监控JVM和实时监控Ganglia.Ambari(5) 1.0 监控ResourceManager进程Java虚拟机中堆空间的特定部分. jstat工具,在JDK的bin目录 ...

  4. Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算

    目标:Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算 1.flume的配置,配置spoolDirSource_hdfsSink.pro ...

  5. Flume(4)-监控模型

    一. 监控端口数据 首先启动Flume任务,监控本机44444端口,服务端: 然后通过netcat工具向本机44444端口发送消息,客户端: 最后Flume将监听的数据实时显示在控制台. 1. 安装n ...

  6. Flume的监控参数

    参考 flume的http监控参数说明 普通的flume启动命令 bin/flume-ng agent -c conf -f conf/flume-conf.properties -n agent - ...

  7. 第1节 flume:7、flume的监控文件夹,实现数据收集到hdfs上

    1.2.2 采集案例 1.采集目录到HDFS 需求分析 结构示意图: 采集需求:某服务器的某特定目录下,会不断产生新的文件,每当有新文件出现,就需要把文件采集到HDFS中去 根据需求,首先定义以下3大 ...

  8. nagios监控ganglia指标,并配置告警

    背景:nagios的监控插件在轻量级方面不如ganglia的gmond,且ganglia在指标监控方面尤其突出的优势,而nagios在配置告警方面也比较方便,正好可以弥补ganglia无法配置告警通知 ...

  9. 开源计算机集群监控Ganglia应用视频

    Ganglia源于Berkeley发起的一个开源集群监视项目,设计用于监测数上千节点的计算机集群.它包含gmond.gmetad以及一个Web前端.可以用来监控系统处理器 .内存.硬盘 I/O.网络流 ...

随机推荐

  1. ES6 class 于 继承 extends

    之前构造函数,没有类的概念,ES6中有了class类这个东西. 简单的一个例子: 输出: 需要注意的是,语法换了,但是构造函数.构造函数的原型.实例的关系还是那样. 输出: 需要注意写法: 底层还是p ...

  2. 使用jMeter对基于SAP ID service进行Authentication的Restful API进行并发测试

    这篇文章本来Jerry只在SAP社区上写了英文版的,可以通过点击文末的"阅读原文"获得.后来有两位做Marketing Cloud开发的德国同事,写邮件询问关于文章的更多细节,声称 ...

  3. JS (二)

    ]1 函数 1 函数就是一段待执行的代码段 2 函数可以实现功能的封装,可以实现代码的复用 3 函数使用: 1 函数声明 2 函数调用 4 语法: 1 函数声明 1 使用function关键字进行函数 ...

  4. c# 执行调用Oracle Procedure传参及回传值

    ////定義參數               //IDataParameter[] parameters =               //             {               ...

  5. CentOS 7 根目录分区扩容

    查看现有磁盘信息,可以看出根分区有96G [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mappe ...

  6. Java 中的多态,一次讲个够之接口实现关系中的多态

    上文还没有写完,这一篇继续 Java 中的多态,一次讲个够之继承关系中的多态 https://www.cnblogs.com/qianjinyan/p/10824576.html 接口实现关系,和继承 ...

  7. MBG(Mybatis Generator)配置

    配置需注意2点, 1.对于匹配所有表用%,多表配合使用_和%,这个和SQL Like查询模糊匹配方法一致 2.配置报错的话,提示如下:标黄的部分其实是正则表达式 The content of elem ...

  8. 笔记本电脑安装jupyterthemes

    上午准备在老笔记本上也装上jupyter themes,竟然遇到一堆问题: 首先直接 pip install jupyterthemes 参考:https://blog.csdn.net/Jinlon ...

  9. Python3+Appium学习笔记05-报错及解决方法

    记录一下使用期间各种报错和解决方法,毕竟搜了半天才找到解决方法.另外提示一下.优先看官方文档. 报错前面都是一样,就是说在处理的时候,服务器发生了一个未知的错误.然后才是具体报错信息 1)seleni ...

  10. python学习之基础入门,安装,字符串,数据转换,三元运算符

    python基础 我们要开始学习新的编程语言了,加油~~ python是“世界上最好的语言”,学习它当然是认为它是最好的所以我们才学(人生苦短我学python),python运用于不同的领域,采集分析 ...