Install Ganglia core (gmond & gmetad) in CentOS 6.x x64

本文涉及的产品
对象存储 OSS,20GB 3个月
对象存储 OSS,内容安全 1000次 1年
对象存储 OSS,恶意文件检测 1000次 1年
简介:
下载最新稳定版的源码
http://ganglia.sourceforge.net/
# wget http://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fganglia%2Ffiles%2Fganglia%2520monitoring%2520core%2F3.6.0%2F&ts=1410227088&use_mirror=cznic

# tar -zxvf ganglia-3.6.0.tar.gz

# cd ganglia-3.6.0


依赖包
[root@db-172-16-3-221 ganglia-3.6.0]# less INSTALL 
Installation Instructions
*************************
Dependencies
============
* APR (http://apr.apache.org/)
* libConfuse (http://www.nongnu.org/confuse/)
* expat (http://expat.sourceforge.net/)
* pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
* python (http://www.python.org/)
* PCRE (http://www.pcre.org/)
* RRDtool (http://oss.oetiker.ch/rrdtool/)


安装apr依赖包

# wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.1.tar.bz2
# tar -jxvf apr-1.5.1.tar.bz2
# cd apr-1.5.1
# yum install -y libtool
# vi configure 
搜索$RM "$cfgfile", 注释, 改成rm -f
    #$RM "$cfgfile"
    rm -f "$cfgfile"

# ./configure --prefix=/opt/apr1.5.1 --enable-shared
# make && make install

# vi /etc/profile
export PATH=/opt/apr1.5.1/bin:$PATH
[root@db-172-16-3-221 apr1.5.1]# . /etc/profile

# vi /etc/ld.so.conf
/opt/apr1.5.1/lib
[root@db-172-16-3-221 apr1.5.1]# ldconfig
[root@db-172-16-3-221 apr1.5.1]# ldconfig -p|grep apr
        libgstdataprotocol-0.10.so.0 (libc6,x86-64) => /usr/lib64/libgstdataprotocol-0.10.so.0
        libapr-1.so.0 (libc6,x86-64) => /opt/apr1.5.1/lib/libapr-1.so.0
        libapr-1.so (libc6,x86-64) => /opt/apr1.5.1/lib/libapr-1.so


安装
libConfuse 依赖包

# wget http://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz
# tar -zxvf confuse-2.7.tar.gz
# cd confuse-2.7
# ./configure --prefix=/opt/confuse2.7 --enable-shared
# gmake && gmake install

# vi /etc/ld.so.conf
/opt/confuse2.7/lib
# ldconfig
# ldconfig -p|grep confu
        libconfuse.so.0 (libc6,x86-64) => /opt/confuse2.7/lib/libconfuse.so.0
        libconfuse.so (libc6,x86-64) => /opt/confuse2.7/lib/libconfuse.so


安装
expat依赖包

# wget http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fexpat%2Ffiles%2Fexpat%2F2.1.0%2F&ts=1410228641&use_mirror=nchc
# tar -zxvf expat-2.1.0.tar.gz 
# cd expat-2.1.0
# ./configure --prefix=/opt/expat2.1.0 --enable-shared
# make && make install
# vi /etc/profile
export PATH=/opt/expat2.1.0/bin:$PATH
export MANPATH=/opt/expat2.1.0/share/man:$MANPATH
# . /etc/profile

# vi /etc/ld.so.conf
/opt/expat2.1.0/lib

# ldconfig
# ldconfig -p|grep expat
        libexpat.so.1 (libc6,x86-64) => /opt/expat2.1.0/lib/libexpat.so.1
        libexpat.so (libc6,x86-64) => /opt/expat2.1.0/lib/libexpat.so


安装
pkg-config依赖包

# wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
# tar -zxvf pkg-config-0.28.tar.gz 
# cd pkg-config-0.28
# ./configure --prefix=/opt/pkg-config0.28 --enable-shared
# make && make install
# vi /etc/profile
# vi /etc/ld.so.conf
# ldconfig
或者
# yum install -y pkgconfig


安装
python 依赖包

编译安装, 注意编辑/etc/profile和/etc/ld.so.conf (有些程序可能依赖2.x的版本, 安装3.x的版本可能会导致一些问题, 需要在启动某些程序时改写一下PATH, 指向依赖的python版本)
或rpm安装
# yum install -y python-devel python


安装
PCRE 依赖包

# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.35%2F&ts=1410229370&use_mirror=jaist
# tar -jxvf pcre-8.35.tar.bz2 
# cd pcre-8.35
# ./configure --prefix=/opt/pcre8.35 --enable-shared --enable-pcre16 --enable-pcre32 --enable-jit --enable-utf8 
# make && make install
# vi /etc/profile
export PATH=/opt/pcre8.35/bin:$PATH
export MANPATH=/opt/pcre8.35/share/man:$MANPATH
# . /etc/profile

# vi /etc/ld.so.conf
/opt/pcre8.35/lib
[root@db-172-16-3-221 lib]# ldconfig
[root@db-172-16-3-221 lib]# ldconfig -p|grep /opt/pcre
        libpcre32.so.0 (libc6,x86-64) => /opt/pcre8.35/lib/libpcre32.so.0
        libpcre32.so (libc6,x86-64) => /opt/pcre8.35/lib/libpcre32.so
        libpcre16.so.0 (libc6,x86-64) => /opt/pcre8.35/lib/libpcre16.so.0
        libpcre16.so (libc6,x86-64) => /opt/pcre8.35/lib/libpcre16.so
        libpcreposix.so.0 (libc6,x86-64) => /opt/pcre8.35/lib/libpcreposix.so.0
        libpcreposix.so (libc6,x86-64) => /opt/pcre8.35/lib/libpcreposix.so
        libpcrecpp.so.0 (libc6,x86-64) => /opt/pcre8.35/lib/libpcrecpp.so.0
        libpcrecpp.so (libc6,x86-64) => /opt/pcre8.35/lib/libpcrecpp.so
        libpcre.so.1 (libc6,x86-64) => /opt/pcre8.35/lib/libpcre.so.1
        libpcre.so (libc6,x86-64) => /opt/pcre8.35/lib/libpcre.so



安装RRDtool依赖包

# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz
# tar -zxvf rrdtool-1.4.8.tar.gz
# cd rrdtool-1.4.8
# yum install -y glib2-devel glib2 cairo-devel cairo pango-devel pango
或者 http://oss.oetiker.ch/rrdtool/pub/libs/
# ./configure --prefix=/opt/rrdtool1.4.8 --enable-shared
# make && make install
# vi /etc/profile
export PATH=/opt/rrdtool1.4.8/bin:$PATH
export MANPATH=/opt/rrdtool1.4.8/share/man:$MANPATH
# . /etc/profile

# vi /etc/ld.so.conf
/opt/rrdtool1.4.8/lib
# ldconfig
[root@db-172-16-3-221 share]# ldconfig -p|grep rrdtool
        librrd_th.so.4 (libc6,x86-64) => /opt/rrdtool1.4.8/lib/librrd_th.so.4
        librrd_th.so (libc6,x86-64) => /opt/rrdtool1.4.8/lib/librrd_th.so
        librrd.so.4 (libc6,x86-64) => /opt/rrdtool1.4.8/lib/librrd.so.4
        librrd.so (libc6,x86-64) => /opt/rrdtool1.4.8/lib/librrd.so


安装ganglia core
# cd ganglia-3.6.0
# LDFLAGS='-L/opt/rrdtool1.4.8/lib -L/opt/apr1.5.1/lib -L/opt/confuse2.7/lib -L/opt/expat2.1.0/lib -L/opt/pcre8.35/lib'  CPPFLAGS='-I/opt/rrdtool1.4.8/include -I/opt/apr1.5.1/include -I/opt/confuse2.7/include -I/opt/expat2.1.0/include -I/opt/pcre8.35/include' ./configure --prefix=/opt/ganglia-core-3.6.0 --enable-shared --enable-status --with-gmetad --with-libapr=/opt/apr1.5.1/bin/apr-1-config 
如果要指定metric模块语言的版本, 可以使用例如with-python等来指定.
依赖的库同样.
  --with-python=PATH      Specify prefix for python or full path to interpreter
  --with-perl=PATH        Specify prefix for perl or full path to interpreter
  --with-php=PATH         Specify prefix for php or full path to php-config
  --with-librrd=DIR       Specify location for librrd
  --with-libapr=PATH      Specify location for libapr-1 or full path to apr-1-config
  --with-libexpat=DIR     Specify location for libexpat
  --with-libconfuse=DIR   Specify location for libconfuse
  --with-libpcre=DIR      Specify location for libpcre
  --with-moduledir=DIR    Base directory for dynamically loadable modules
  --with-memcached        enable memcached metrics publishing
  --with-systemdsystemunitdir=DIR
                          Directory for systemd service files
  --with-zlib=DIR         Specify location for zlib

# make && make install
# cd /opt/ganglia-core-3.6.0/
[root@db-172-16-3-221 ganglia-core-3.6.0]# ll
total 24
drwxr-xr-x 2 root root 4096 Sep  9 11:03 bin
drwxr-xr-x 3 root root 4096 Sep  9 11:03 etc
drwxr-xr-x 2 root root 4096 Sep  9 11:03 include
drwxr-xr-x 3 root root 4096 Sep  9 11:03 lib64
drwxr-xr-x 2 root root 4096 Sep  9 11:03 sbin
drwxr-xr-x 3 root root 4096 Sep  9 11:03 share

# vi /etc/profile
export PATH=/opt/ganglia-core-3.6.0/bin:/opt/ganglia-core-3.6.0/sbin:$PATH
export MANPATH=/opt/ganglia-core-3.6.0/share/man:$MANPATH
# . /etc/profile

# vi /etc/ld.so.conf
/opt/ganglia-core-3.6.0/lib64
# ldconfig
# ldconfig -p|grep ganglia
        libganglia-3.6.0.so.0 (libc6,x86-64) => /opt/ganglia-core-3.6.0/lib64/libganglia-3.6.0.so.0


[root@db-172-16-3-221 ganglia-core-3.6.0]# cd etc/
[root@db-172-16-3-221 etc]# ll
total 12
drwxr-xr-x 2 root root 4096 Sep  9 11:03 conf.d
-rw-r--r-- 1 root root 7905 Sep  9 11:03 gmetad.conf
[root@db-172-16-3-221 etc]# cd conf.d/
[root@db-172-16-3-221 conf.d]# ll
total 4
-rw-r--r-- 1 root root 418 Sep  9 11:03 modpython.conf

最后, 如果暂时不想使用python modulre的话, 可以把这个配置文件重命名先.
[root@db-172-16-3-221 ganglia-core-3.6.0]# cd etc/
[root@db-172-16-3-221 etc]# ll
total 12
drwxr-xr-x 2 root root 4096 Sep  9 11:03 conf.d
-rw-r--r-- 1 root root 7905 Sep  9 11:03 gmetad.conf
[root@db-172-16-3-221 etc]# cd conf.d/
[root@db-172-16-3-221 conf.d]# ll
total 4
-rw-r--r-- 1 root root 418 Sep  9 11:03 modpython.conf
[root@db-172-16-3-221 conf.d]# mv modpython.conf modpython.conf.bak


[注意]
1. gmond主机部署需要注意几项. (反向主机名解析, 时钟同步, 防火墙)

[参考]
1. man

./man1:
total 20
-rw-r--r-- 1 root root 2104 Sep  9 11:03 gmetad.1
-rw-r--r-- 1 root root 1177 Sep  9 11:03 gmetad.py.1
-rw-r--r-- 1 root root 2894 Sep  9 11:03 gmetric.1
-rw-r--r-- 1 root root 2680 Sep  9 11:03 gmond.1
-rw-r--r-- 1 root root 2412 Sep  9 11:03 gstat.1

./man5:
total 32
-rw-r--r-- 1 root root 29825 Sep  9 11:03 gmond.conf.5


2. README
3. INSTALL

Installation Instructions
*************************

Dependencies
============

* APR (http://apr.apache.org/)
* libConfuse (http://www.nongnu.org/confuse/)
* expat (http://expat.sourceforge.net/)
* pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
* python (http://www.python.org/)
* PCRE (http://www.pcre.org/)
* RRDtool (http://oss.oetiker.ch/rrdtool/)


目录
相关文章
|
5月前
|
Linux Shell Python
centos执行pip3 install etcd3报错
centos执行pip3 install etcd3报错
|
7月前
|
关系型数据库 MySQL Linux
Linux部署实战前言,MySQL在CentOS安装【单机软件】,MySQL的安装需要root权限,yum install mysql,systemctl enable mysqld开机自启的意思
Linux部署实战前言,MySQL在CentOS安装【单机软件】,MySQL的安装需要root权限,yum install mysql,systemctl enable mysqld开机自启的意思
|
9月前
|
存储 监控 Linux
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
【2月更文挑战第17天】Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
222 1
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
|
9月前
|
存储 监控 Linux
Ganglia【部署 01】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
Ganglia【部署 01】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
148 0
|
9月前
|
Linux Docker 容器
CentOS7 Install Docker Compose
CentOS7 Install Docker Compose
175 0
|
监控 Ubuntu Linux
Centos7安装ganglia监控
Centos7安装ganglia监控
340 0
Centos7安装ganglia监控
|
缓存 网络协议 Linux
CentOS8 yum install 报错Cannot prepare internal mirrorlist: No URLs in mirrorlist解决(替换yum源)
CentOS8 yum install 报错Cannot prepare internal mirrorlist: No URLs in mirrorlist解决(替换yum源)
CentOS8 yum install 报错Cannot prepare internal mirrorlist: No URLs in mirrorlist解决(替换yum源)
|
Linux Docker 容器
|
Linux
Centos下pip3 install pycrypto安装失败的解决办法
Centos下pip3 install pycrypto安装失败的解决办法
1590 0
Centos下pip3 install pycrypto安装失败的解决办法
|
弹性计算 关系型数据库 Linux
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2
In this tutorial, we will be setting up CMS Made Simple on a LAMP stack with an Alibaba Cloud ECS instance (CentOS 7.2).
3939 0
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2