Ganglia的安装主要分为两大部分:
一部分为主控端,安装ganglia-web和gmetad,一部分为被控端,安装gmond。
一、主控端,安装ganglia-web和gmetad
主控端只需要集中在一台服务器上就可以,用于集中管理、展示需要被监控的服务器。
SSH下,root用户:安装相关依赖
yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpm-build glib2-devel dbus-devel freetype-devel fontconfig-devel gcc gcc-c++ expat-devel python-devel libXrender-devel
yum install -y libart_lgpl-devel pcre-devel libtool
yum install -y rrdtool rrdtool-devel
1、安装ganglia-web和gmetad
yum install -y epel-release
yum install -y ganglia-web.x86_64
yum install -y ganglia-gmetad.x86_64
2、启动 gmetad 服务
systemctl start gmetad.service
3、gmetad的配置文件更改
vi /etc/ganglia/gmetad.conf
data_source “bigdata-kylin” localhost
gridname “kylin”
setuid_username ganglia
case_sensitive_hostnames 0
备注:其中data_source “bigdata-kylin” localhost 此处设置cluster名称,gmond端务必一致,特别是在多播模式中,依此进行识别,最后的localhost是gmond传输的节点IP,因为设置gmond端将所有数据传输于gmetad处的的gmond节点,所以可以设置为localhost
4、新建站点,配置ganglia目录
root /usr/share/ganglia
5、设置缓存等文件目录权限
chmod 777 -R /var/lib/ganglia-web/dwoo/compiled
chmod 777 -R /var/lib/ganglia-web/dwoo/cache
6、开放端口 5649
7、设置 开机启动
systemctl start gmetad.service
systemctl enable gmetad.service
二、被控端,gmond端安装、设置
1、安装gmond
yum install -y epel-release
yum install -y ganglia-gmond
2、配置修改
vi /etc/ganglia/gmond.conf
cluster {
name = "bigdata-kylin" ##需要与gmetad中定义的datasource名称一致
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 {
#mcast_join = 239.27.1.1 ## 此处为多播设置,单播模式要去掉
host = 10.239.1.35 ##向gmond传送数据的ip(ganglia-web),设置
port = 8649 ## 接收gmond节点的端口
ttl = 1
}
/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
port = 8649 ##gmond自身节点的端口
bind = 0.0.0.0 ##gmond监听地址,去掉也可以
retry_bind = true
}
3、设置开机启动
systemctl start gmond.service
systemctl enable gmond.service
本文来自投稿,不代表本站立场,如若转载,请注明出处: