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服务即可;
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服务即可;