集群监视软件Ganglia

article/2025/9/16 1:26:05
什么是ganglia
Ganglia监控软件主要是用来监控系统性能的软件,如:cpu 、mem、硬盘利用率, I/O负载、网络流量情况等,通过曲线很容易见到每个节点的工作状态,对合理调整、分配系统资源,提高系统整体性能起到重要作用。

Ganglia的组成
ganglia 是分布式的监控系统,有两个Daemon, 分别是:客户端Ganglia Monitoring Daemon (gmond)和服务端Ganglia Meta Daemon (gmetad)

什么是PHP Web Frontend
Php Web Frontend 是Ganglia的一套基于php开发和运行的web统计浏览程序

什么是PHP
PHP是一个基于服务端来创建动态网站的脚本语言,您可以用PHP和HTML生成网站主页。当一个访问者打开主页时,服务端便执行PHP的命令并将执行结果发送至访问者的浏览器中,这类似于ASP和CoildFusion,然而PHP和他们不同之处在于PHP开放源码和跨越平台,PHP可以运行在WINDOWS NT和多种版本的UNIX上。它不需要任何预先处理而快速反馈结果,它也不需要mod_perl的调整来使您的服务器的内存映象减小。PHP消耗的资源较少,当PHP作为Apache Web服务器一部分时,运行代码不需要调用外部二进制程序,服务器不需要承担任何额外的负担。

什么是RRDtool
RRDtool是系统存放和显示time-series (即网络带宽、温度、人数、服务器负载等) ,并且它额可以绘出有用的图表用来显示处理的数据和数据密度。

相关资源
 
http://www.ganglia.info
Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It relies on a multicast-based listen/announce protocol to monitor state within clusters and uses a tree of point-to-point connections amongst representative cluster nodes to federate clusters and aggregate their state. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on over 500 clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.
The ganglia system is comprised of two unique daemons, a PHP-based web frontend and a few other small utility programs.
Ganglia Monitoring Daemon (gmond)

Gmond is a multi-threaded daemon which runs on each cluster node you want to monitor. Installation is easy. You don't have to have a common NFS filesystem or a database backend, install special accounts, maintain configuration files or other annoying hassles.
Gmond has four main responsibilities: monitor changes in host state, announce relevant changes, listen to the state of all other ganglia nodes via a unicast or multicast channel and answer requests for an XML description of the cluster state.

Each gmond transmits in information in two different ways: unicasting/multicasting host state in external data representation (XDR) format using UDP messages or sending XML over a TCP connection.

Ganglia Meta Daemon (gmetad)

Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon (gmetad) periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either gmond daemons, representing specific clusters, or other gmetad daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for failover. The latter capability is natural for aggregating data from clusters since each gmond daemon contains the entire state of its cluster.

Ganglia PHP Web Frontend

The Ganglia web frontend provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web frontend to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colorful history of all collected data.
The Ganglia web frontend caters to system administrators and users. For example, one can view the CPU utilization over the past hour, day, week, month, or year. The web frontend shows similar graphs for Memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics.

The web frontend depends on the existence of the gmetad which provides it with data from several Ganglia sources. Specifically, the web frontend will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behavior leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web frontend should run on a fairly powerful, dedicated machine if it presents a large amount of data.

The Ganglia web frontend is written in the PHP scripting language, and uses graphs generated by gmetad to display history information. It has been tested on many flavours of Unix (primarily Linux) with the Apache webserver and the PHP 4.1 module.


  http://www.php.net
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

  http://www.rrdtool.org

RRD is the Acronym for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, server load average). It stores the data in a very compact way that will not expand over time, and it can create beautiful graphs. It can be used via simple shell scripts or as a perl module.

具体安装步骤

安装环境 Redhat AS3 update4 with Apache
安装软件 rrdtool-1.0.49  Ganglia3.0.1 PHP4.4.0 Ganglia-web-3.0.0-1

安装RRDTool

gmetad需要先安装RRDTool,默认的安装路径:/usr/local/rrdtool-1.0.49
Your_prompt>tar rrdtool.tar.gz
Your_prompt>cd rrdtool-1.0.49
Your_prompt>./configure
Your_prompt>make
Your_prompt>make install
更改rrdtool-1.0.49名称为rrdtool
Your_prompt>mv rrdtool-1.0.49 rrdtool
rrd.h in /usr/local/rrdtool/include/rrd.h
librrd.a in /usr/local/rrdtool/lib/librrd.a

Server端的安装和配置

gmetad的安装

gmetad不是默认安装的,安装时需要加参数 --with-gmetad 。即rrdtool库及其头文件必须存在,默认的路径是/usr/include/rrd.h和 /usr/lib/librrd.a,如果在安装rrdtool时安在了不同的路径下,这里需要指明它们的路径。
./configure CFLAGS="-I/rrd/header/path" CPPFLAGS="-I/rrd/header/path" /
LDFLAGS="-L/rrd/library/path" --with-gmetad
Your_prompt>tar –zxvf ganglia-3.0.1.tar.gz
Your_prompt>cd ganglia-3.0.1
Your_prompt>./configure CFLAGS="-I/rrd/header/usr/local/rrdtool/include/rrd.h"
CPPFLAGS="-I/rrd/header/usr/local/rrdtool/include/rrd.h "
LDFLAGS="-L/rrd/library/usr/local/rrdtool/lib/librrd.a " --with-gmetad
Your_prompt>make
Your_prompt>make install

为了保证在开始时启动,需要将gmetad.init文件拷贝到 /etc/rc.d/init.d/
Your_prompt> cd ganglia-3.0.1/gmetad
Your_prompt> cp gmetad.init /etc/rc.d/init.d/gmetad

将配置文件拷贝到/etc目录下
Your_prompt> cp gmetad.conf /etc/gmetad.conf
Add GMETAD to the list of programs at startup
Your_prompt> chkconfig --add gmetad
Your_prompt> chkconfig --list gmetad
GMETAD 0:off 1:off 2:on 3:on 4:on 5:on 6:off

启动gmetad
Your_prompt>/etc/rc.d/init.d/gmetad start
Starting GANGLIA gmetad: [ OK ]
Your_prompt>telnet localhost 8651 | grep “hostname”
就可以得到监控的各个主机的状态。

gmetad.conf的配置
# data_source "another source" 1.3.4.7:8655 1.3.4.8
data_source "SERVER" 10 node1 node2
data_source是最重要的参量,在GMOND的Cluser name配置必须与data_source的相同,这个参量被设置为群的名字,被监测以便能监测那群状态。如果有二个或更多监测对象,当有一对象不能被监测,将读取data_source 配置的下一个对象

client端安装和配置

Your_prompt>tar –zxvf ganglia-3.0.1.tar.gz
Your_prompt>cd ganglia-3.0.1
Your_prompt>./configure
Your_prompt>make
Your_prompt>make install
Your_prompt>cd gmond
Your_prompt>gmond –t > /etc/gmond.conf
Your_prompt>cp gmond.init /etc/rc.d/init.d/gmond
Your_prompt> chkconfig --add gmond
Your_prompt> chkconfig --list gmond
gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Your_prompt>/etc/rc.d/init.d/gmond start
Starting GANGLIA gmond: [ OK ]
Your_prompt>telnet localhost 8649 就可以获取机群内运行gmond的主机的信息

配置gmond.conf

vi /etc/gmond.conf
globals {
setuid = no
user = nobody
cleanup_threshold = 300 /*secs */
}
修改为
setuid = yes
user = scett #本机用户名

cluster {
name = "unspecified" #Cluser name
}
修改监控组名称
name = “SERVER”
配置完成后重新启动gmond.

安装php4.40

tar zxvf php-4.4.0.tar.gz
cd php-4.4.0
./configure --prefix=/usr/local/php --with-config-filepath=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-openssl=/usr/local/ssl
--with-mysql=/usr/local/mysql
make
make install

修改apache配置文件
Vi /etc/httpd/conf/httpd.conf

  LoadModule php4_module    extramodules/libphp4.so
  AddModule mod_php4.c
    AddType  application/x-httpd-php         .php .php4 .php3 .phtml
  AddType  application/x-httpd-php-source  .phps

安装 php web frontend

rpm -Uvh ganglia-web-3.0.0-1.i386.rpm

最终通过 http://server/ganglia 访问页面如下




http://chatgpt.dhexx.cn/article/cdGgv37V.shtml

相关文章

Linux集群管理软件clustershell

Linux集群管理软件clustershell 1.简介 机房有大概百台的服务器需要管理,加上需要搭建Hadoop以及Spark集群等,因此,一个轻量级的集群管理软件就显得非常有必要了。经过一段时间的了解以及尝试,最终选择了clustershell这个软件&…

计算机集群

计算机集群简称集群是一种计算机系统, 它通过一组松散集成的计算机软件和/或硬件连接起来高度紧密地协作完成计算工作。在某种意义上,他们可以被看作是一台计算机。集群系统中的单个计算机通常称为节点,通常通过局域网连接,但也有…

HAProxy集群与常见的Web集群软件调度器对比

目录 一.常见的Web集群调度器 二.HAProxy基本介绍 1.HAProxy是什么? 2.HAProxy的特性 3.HAProxy常用的8种负载均衡调度算法 3.1 轮询:RR(Round Robin) 3.2 最小连接数:LC(Least Connections&#xf…

[Linux基础与服务管理——常用集群高可用软件 Keepalived]

1.Keepalived 简介 Keepalived是Linux下的一个免费的、轻量级的高可用解决方案。是一个由C语言编写的路由软件,主要目标是为Linux系统和基于Linux的基础架构提供简单而强大的负载平衡和高可用性设。Keepalived实现了一组检查器,以根据其健康状况动态地和…

高性能集群软件keepalived

背景 网络的飞速发展,给网络带宽和服务器性能带来了巨大的挑战,基于互联网的应用系统越来越多地瓶颈出现在服务器端,这就对服务器提出了更高的要求,来保证服务的持续性。 集群简介 定义:集群是一组协同工作的服务集合…

集群分为几种,用的软件分别是什么?

集群分为几种,用的软件分别是什么? 补充:涉及的组件 1.1、apache 跨平台的网页服务器,主要使用它做静态资源服务器,也可以做代理服务器转发请求 1.2、ngnix 高性能的 HTTP和反向代理服务器,ngnix处理能力相当于apache…

Linux下的5款主流高可用集群软件介绍

Linux集群主要分成三大类:高可用集群(High Availability Cluster)、负载均衡集群(Load Balance Cluster)、科学计算集群(High Performance Computing Cluster)。 其中高可用集群具有保障应用程序持续提供服务的能力,可以将因软、硬件、人为造成的故障对业务的影响降低到最小…

Horizon Daas 桌面报错:desktop agent通信错误

一、故障描述 上述错误是因无法解析来自身份验证错误响应中的错误时,会报出。这往往时由于horizon client与TA,view agent之间的通信中断造成的。造成在desktone.log日志里可看到相关warning或error,如下所示: 二、分析处理 1、…

一文看懂数据服务DaaS

数据是国家的,金融是国家的。朕不给,你不能要。 (1)中国数据服务 一、数据工具 像云计算厂商搞的大数据平台,就是这个定位。它们纯搞产品,做好品牌,做好合作伙伴招募,由合作伙伴去做…

IaaS、PaaS、SaaS、DaaS的区别与联系

按照服务划分,云计算可以分为IaaS、PaaS、SaaS、DaaS四个层次。 IaaS(Infrastructure as a Service,基础架构即服务)是基础层。在这一层,通过虚拟化、动态化将IT基础资源(计算、网络、存储)聚合…

Horizon Daas浮动桌面无法删除解决

Horizon Daas浮动桌面无法删除解决 【问题描述】 某次执行对桌面删除重新分配操作,发现桌面功能下拉列表里,未出现删除选项,【浮动桌面】无法删除,即无法释放所占资源。 【问题分析】 经检查发现,原来此类桌面为“…

关于Daas平台无法登录的故障处理

关于Daas平台无法登录的故障处理 【事件描述】 某天对Daas桌面环境中AD域控服务器进行挂起,执行克隆备份操作后,再次开启AD域控后,登录短少系统报错:身份验证失败,无法登录。如下图所示: 【故障分析及处…

daas 数据即服务_万物物联时代,数据即服务

关于DAAS的概念 1.未来万物互联,数据就是服务 如何利用移动通信将万物互联,彻底实现智能化,是当前发展的愿景。在这个愿景之下,我们希望能够建立统一的框架,把人的通讯问题、万物互联的问题囊括其中,以超高…

跑出了几个明星厂商,DaaS赛道要火?

图片来源于Unsplash 文丨螳螂观察 作者丨陈淼 从今年的形势来判断,DaaS(数据即服务)赛道看来要火。 相关的信号有两个。 6月末,阿里成立了一家子公司,瓴羊智能服务公司。根据介绍,这家公司将把阿里巴巴…

IaaS、PaaS、SaaS、DaaS的区别

1.IaaS IaaS是Infrastructure as a server的缩写,意思是基础设施即服务。又云端公司把IT环境的基础设施建设好,然后直接对外出租硬件服务器或者虚拟机。消费者可以利用所有计算基础设施,包括处理CPU、内存、存储、网络和其它基本的计算资源&…

Tapdata 在线研讨会:DaaS vs 大数据平台,是竞争还是共处?

从20年前的传统数仓,到10年前大数据平台,5年前开始火热的数据中台以及最近出现的湖仓一体新数据平台,今天被数据孤岛困扰的企业,面临着太多的选择。这些数据产品及架构有一个共性:他们本质上解决的大部分都是分析洞察类…

云目录(DaaS )快速入门

目录即服务(Directory-as-a-Service,DaaS)是针对企业用户存储的云解决方案,将 LDAP 或微软 Active Directory(AD)作为云服务进行管理。DaaS 和很多云平台一样,不仅仅是基于云的 AD 或LDAP不单单…

关于Horizon DaaS Platform的一些疑问

问: DaaS 是什么意思? 答: DaaS 的含义是“Desktops as a Service”(桌面即服务)。 问:所谓的“以云计算服务的形式交付 Windows 桌面或应用”是什么意思? 答:是指云提供商利用他们…

数据中台:始于阿里,兴于DaaS

2014年,马云从芬兰一家游戏公司Supercell接触到中台概念后,在阿里内部积极践行,开创了“大中台、小前台”的组织机制和业务机制。 阿里数据中台的理念是通过高效、统一的后方系统来支撑快速变化的前端业务,提高业务产出效率&…

daas(daas医学上是什么意思)

什么是氨基酸评分 本词条缺少概述、名片图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧! 氨基酸评分 别称 蛋白质化学评分 消化率评分 (PCDAAS)氨基酸评分真消化率 2计算公式 3经消化率修正的氨基酸评分 1简介编辑 氨基酸…