知识共享许可协议
本作品采用知识共享署名-非商业性使用-禁止演绎 3.0 未本地化版本许可协议进行许可。

更新源
yum install wget gcc make rsync

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum makecache
安装依赖包
yum install apr-devel zlib-devel libconfuse-devel expat-devel pcre-devel
安装Ganglia
http://ganglia.info/

wget http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz/download -O ~/ganglia-3.6.0.tar.gz

tar zxvf ganglia-3.6.0.tar.gz
cd ganglia-3.6.0

./configure --prefix=/usr/local/ganglia-3.6.0 --enable-gexec --enable-status --with-libconfuse --with-zlib
make
make install
配置
  • 设置软链接

    ln -s /usr/local/ganglia-3.6.0/sbin/gmond /usr/bin/gmond
    
  • 复制服务启动文件

    cp ~/ganglia-3.6.0/gmond/gmond.init /etc/rc.d/init.d/gmond
    chkconfig --add gmond
    chkconfig gmond on
    
  • 修改配置文件

    vi /etc/init.d/gmond
    GMOND=/usr/local/ganglia-3.6.0/sbin/gmond
    daemon $GMETAD -c /etc/ganglia/gmond.conf
    
  • 生成初始文件

    mkdir -p /etc/ganglia
    mkdir -p /usr/local/ganglia-3.6.0/lib64/ganglia/python_modules 
    gmond -t | tee /etc/ganglia/gmond.conf
    
  • 修改gmond.conf

    vi /etc/ganglia/gmond.conf
    
    cluster {
        name = "ganglia.monitor"
        owner = "unspecified"
        latlong = "unspecified"
        url = "unspecified"
    }
    
    udp_send_channel {
        host = ganglia.monitor
        port = 8649
        ttl = 1
    }
    
    udp_recv_channel {
        port = 8649
    }
    tcp_accept_channel {
        port = 8649
    }
    
启动
service gmond start