1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
| [iyunv@centos02 tools]# wget wget
[iyunv@centos02 tools]# rpm -ivh epel-release-6-8.noarch.rpm
[iyunv@centos02 tools]# yum install ganglia-gmetad.x86_64 ganglia-gmond.x86_64 ganglia-gmond-python.x86_64 -y
修改服务端配置文件
[iyunv@centos02 tools]# vim /etc/ganglia/gmetad.conf
data_source "my cluster" 172.16.80.117 172.16.80.116
gridname "MyGrid"
ganglia web的安装(基于LNMP环境)
[iyunv@centos02 tools]# tar xf ganglia-web-3.7.2.tar.gz
[iyunv@centos02 tools]# mv ganglia-web-3.7.2 /application/nginx/html/ganglia
修改ganglia web的php配置文件
[iyunv@centos02 tools]# vim /application/nginx/html/ganglia/conf_default.php
$conf['gweb_confdir'] = "/application/nginx/html/ganglia";
nginx配置
[iyunv@centos02 ganglia]# cat /application/nginx/conf/nginx.conf
worker_processes 2;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.martin.com martin.com;
location / {
root html/zabbix;
index index.php index.html index.htm;
}
location ~ .*\.(php|php5)?$ {
root html/zabbix;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_zabbix.log main;
}
server {
listen 80;
server_name ganglia.martin.com;
location / {
root html/ganglia;
index index.php index.html index.htm;
}
location ~ .*\.(php|php5)?$ {
root html/ganglia;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_bbs.log main;
}
###status
server{
listen 80;
server_name status.martin.org;
location / {
stub_status on;
access_log off;
}
}
}
访问测试,报错如下
Fatal error:Errors were detected in your configuration.
DWOO compiled templates directory '/application/nginx/html/ganglia/dwoo/compiled' is not writeable.
Please adjust $conf['dwoo_compiled_dir'].
DWOO cache directory '/application/nginx/html/ganglia/dwoo/cache' is not writeable.
Please adjust $conf['dwoo_cache_dir'].
in /application/nginx-1.6.3/html/ganglia/eval_conf.php on line 126
解决办法:
[iyunv@centos02 tools]# mkdir /application/nginx/html/ganglia/dwoo/compiled
[iyunv@centos02 tools]# mkdir /application/nginx/html/ganglia/dwoo/cache
[iyunv@centos02 tools]# chmod 777 /application/nginx/html/ganglia/dwoo/compiled
[iyunv@centos02 tools]# chmod 777 /application/nginx/html/ganglia/dwoo/cache
[iyunv@centos02 html]# chmod -R 777 /var/lib/ganglia/rrds
修改客户端配置文件(所有的客户端都需要做)
[iyunv@centos02 tools]# vim /etc/ganglia/gmond.conf
cluster {
name = "my cluster" #这个名字要和服务器端定义的data_source后面的名字一样
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.80.117 #这里我们采用单播方式,默认是组播
port = 8649
# ttl = 1
}
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
}
|