1.准備安裝包
ganglia-3.7.2-2.el6.x86_64.rpm
ganglia-gmetad-3.7.2-2.el6.x86_64.rpm
ganglia-gmond-3.7.2-2.el6.x86_64.rpm
ganglia-gmond-python-3.7.2-2.el6.x86_64.rpm
ganglia-web-3.7.1-2.el6.x86_64.rpm
2.所需依賴包
libconfuse-2.7-4.el6.x86_64.rpm
rrdtool-1.3.8-6.el6.x86_64.rpm
rrdtool-devel-1.3.8-6.el6.x86_64.rpm
php-bcmath-5.3.3-22.el6.x86_64.rpm
php-process-5.3.3-22.el6.x86_64.rpm
php-ZendFramework-1.11.10-1-mdv2012.0.noarch.rpm
3.安裝
rpm -ivh ganglia-3.7.2-2.el6.x86_64.rpm
rpm -ivh ganglia-gmond-3.7.2-2.el6.x86_64.rpm
rpm -ivh ganglia-gmond-python-3.7.2-2.el6.x86_64.rpm
rpm -ivh ganglia-gmetad-3.7.2-2.el6.x86_64.rpm
yum install ganglia-web-3.7.1-2.el6.x86_64.rpm(web建議用yum安裝,涉及一些鏡像自帶的安裝包,比較方便)
yum install httpd
4.配置
本地想安裝一個gmetad高可用,因為項目生產中安裝的ganglia前台圖標出現了有規律的斷開現象,原因初步懷疑網絡問題,但是想從ganglia自身先考慮下優化方案。
①gmetad.conf
hdp1:
data_source "zhj" localhost
gridname "ZHJ"
hdp2:
data_source "zhj" hdp1
gridname "ZHJ"
②gmond.conf
hdp1:
cluster {
name = "zhj"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
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 = 172.16.196.141
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 = 239.2.11.71
#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
}
tcp_accept_channel {
port = 8649
# If you want to gzip XML output
gzip_output = no
}
hdp2、hdp3:
cluster {
name = "zhj"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
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 = 172.16.196.141
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 = 239.2.11.71
#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
}
tcp_accept_channel {
#port = 8649
# If you want to gzip XML output
gzip_output = no
}
③gweb
rpm包默認的安裝地址是/usr/share/ganglia
節點:hdp1
需修改的配置文件:
vi /etc/httpd/conf.d/ganglia.conf
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
Order deny,allow
#Deny from all
Allow from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>
vi /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /usr/share/ganglia ##conf_default所在目錄
ServerName myganglia
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
5.啟動
hdp1-hdp3依次
service gmond start
hdp1-2依次
service gmetad start
hdp1
service httpd start
6.驗證結果