Ganglia是一套主機資源監控的軟體~
大概就是看看cpu/ram/網路資源使用量降子~
原生是linex系統的東東~
資源監控~偶看大概都不跳出這些作法~
會有一台主要server, 搜集資訊, 提供網頁/AP, 儀板表介面~
另外會有所謂像agent這樣的東西~ 裝在其他監控的主機上...
定期把資訊送到server, 或是由server從agent機器上拉過去...
不過這樣子也合理啦~ 因為監控很多是監控到主機硬體資源的使用部分~
正常主機~ 是不會讓其他主機access硬體資訊的...
ganglia分為三個部分~
ganglia-gmetad --> 資料整合(server裝就好)
ganglia-web --> 提供http介面(server裝就好), 使用的是php的套件, 所以要先裝好httpd
ganglia-gmond --> 資料收集(要監控的機器都要裝)
上面套件安裝好後~ 會變成centos上的service, 所以需要開機啟動的話~ 就自己要再去開啟
web介面是沒有帳號權限的~ 就是裝好後~ 連網址就可以直接看到內容~
重點大概就是注意gmond, cluster的 name 要與gmetad的datasource名稱一致, 這樣才對得上..該名稱也會顯示在頁面上~就當成是server群組的名稱吧~
agent/server 溝通的port default是 8649, 要走別的port, gmetad主機後要加port
gmond裡, 還有可以改的大概就是host.location, 填主機的名字以方便識別
udp_send_channel改一下, ttl=1才會live, host給自己的IP, 其他check一下是否有差別
安裝方式如下:
su
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install ganglia ganglia-gmetad ganglia-web ganglia-gmond
#only client without server
#yum install ganglia ganglia-gmond
##if everything OK, ganglia will be installed /etc/ganglia/
## httpd page installed /usr/share/ganglia
vim /etc/ganglia/gmetad.conf
##Update data source name and ip address : data_source "OnSite_QA" 60 ipaddress
##If you define 60 every 60 seconds the data will poll from the ganglia monitoring daemons
data_source "hadoop" 60 192.168.3.xx1 192.168.3.xx2 192.168.3.xx3 192.168.3.xx4
vim /etc/ganglia/gmond.conf
cluster {
name = "hadoop" ##modify
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
host {
location = "host1"
}
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
port = 8649
host = 192.168.3.xx1
ttl = 1
}
udp_recv_channel {
port = 8649
}
tcp_accept_channel {
port = 8649
}
##start service
#/etc/init.d/gmetad restart
#/etc/init.d/gmond restart
service gmetad restart
service gmond restart <--better
service httpd restart
##change php allow
vim /etc/httpd/conf.d/ganglia.conf
<Location /ganglia>
Order deny,allow
#Deny from all ##modify here
Allow from all ##modify here
Allow from ::1
# Allow from .example.com
</Location>
沒有留言:
張貼留言