1. 程式人生 > >有關於centos下ganglia的安裝部署心得

有關於centos下ganglia的安裝部署心得

1  Ganglia安裝
1.1  中心節點的安裝
epel包的安裝:yum install -y epel-release(解決不能yum安裝某些安裝包的問題)
gmetad的安裝:yum install -y ganglia-gmetad ganglia-devel 
gmond的安裝:yum install -y ganglia-gmond
rrdtool的安裝:yum install -y rrdtool
httpd伺服器的安裝:yum install -y httpd
ganglia-web及php安裝:yum install -y ganglia-web php


1.2  被監測節點的安裝
epel包的安裝:yum install -y epel-release(解決不能yum安裝某些安裝包的問題)
gmond的安裝:yum install -y gmond(提示找不到,感覺應該換成上面那個yum install -y ganglia-gmond)





1.3安裝目錄說明
ganglia配置檔案目錄:/etc/ganglia
rrd資料庫存放目錄:/var/lib/ganglia/rrds
httpd主站點目錄:/var/www/html
ganglia-web安裝目錄:/usr/share/ganglia
ganglia-web配置目錄:/etc/httpd/conf.d/ganglia.conf


2中間配置部分


2.1.2  相關配置檔案修改
將ganglia-web安裝目錄連結到httpd主站點目錄
#  將ganglia-web的站點目錄連線到httpd主站點目錄$  ln -s /usr/share/ganglia /var/www/html
 
 
修改httpd主站點目錄下ganglia站點目錄的訪問許可權
#  將ganglia站點目錄訪問許可權改為apache:apache,否則會報錯$  chown -R apache:apache /var/www/html/ganglia$  chmod -R 755 /var/www/html/ganglia
修改rrd資料庫存放目錄訪問許可權
#  將rrd資料庫存放目錄訪問許可權改為nobody:nobody,否則會報錯$  chown -R nobody:nobody /var/lib/ganglia/rrds
修改ganglia-web的訪問許可權:修改/etc/httpd/conf.d/ganglia.conf
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
 Require all granted
 #Require ip 10.1.2.3
 #Require host example.org
</Location>
 
修改dwoo下面的許可權
chmod 777 /var/lib/ganglia/dwoo/compiled
chmod 777 /var/lib/ganglia/dwoo/ cache
 
配置/etc/ganglia/gmetad.conf
data_source  "hadoopcluster" 192.168.26.139:8649 (注意是所有節點都加上,如master:8649 slave0x:8649)
 
setuid_username nobody
配置/etc/ganglia/gmond.conf
cluster {
  name = "hadoop cluster"
  ...
}
udp_send_channel {
  # the host who gather this cluster's monitoring data and send these data   to gmetad node
  #註釋掉多播模式的,以下出現這個都要註釋掉
 #mcast_join = 239.2.11.71
 #新增單播模式的
 host = 192.168.26.139  
 port = 8649
}
udp_recv_channel {
  port = 8649
}
tcp_accept_channel {
  port = 8649
}
 
 
 
2.2  Hadoop cluster被監測節點的配置
配置/etc/ganglia/gmond.conf
cluster {
  name = "hadoop cluster"
  ...
}
udp_send_channel {
  # the host who gather this cluster's monitoring data and send these data   to gmetad node
 host = 192.168.26.139  
 port = 8649
}
udp_recv_channel {
  port = 8649
}
tcp_accept_channel {
  port = 8649
}


主機開啟
service gmetad start
service gmond start
service httpd start
從機開啟
service gmetad start


service gmetad status    -------------------驗證是否啟動成功
service gmond status


更新Telnet
yum install telnet-server
yum install telnet.*


檢視是否監控到html,
telnet 192.168.100.3 8649


ps aux | grep gmond




檢視伺服器web錯誤
tail -f /var/log/apache2/error_log






解決方案:


1.出現configuration error:  couldn't perform authentication. AuthType not set!: /  500伺服器錯誤
sudo vi /etc/httpd/conf.d/ganglia.conf
<Directory />
    Require all granted
</Directory>
屬於2.4.*版本
將“Require all granted”刪除……


2.如果根據service httpd status
httpd 已死,但是 subsys 被鎖


編輯/etc/sysconfig/iptables
新增如下內容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
然後重啟一下iptables服務可;


3.問題總結:
啟動時,如果提示如下資訊:
正在啟動 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
編輯/etc/httpd/conf/httpd.conf
找到如下內容:
#ServerName www.example.com:80
更改為
ServerName localhost:80
再重啟一下Apache服務即可;