1.查看是否需要增加yum 源
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@node-12 ~]# yum search collectdLoaded plugins: fastestmirrorDetermining fastest mirrors * base: mirrors.skyshe.cn * extras: mirrors.skyshe.cn * updates: mirrors.btte.netbase | 3.7 kB 00:00 extras | 3.4 kB 00:00 nailgun | 1.3 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 888 kB 00:00 Warning: No matches found for: collectdNo Matches found[root@node-12 ~]# |
发现没有我们需要的collectd软件包。需要增加软件源epel.
|
1
2
3
4
5
|
[root@node-12 ~]# rpm -Uvh http://mirrors.hustunique.com/epel//6/x86_64/epel-release-6-8.noarch.rpmRetrieving http://mirrors.hustunique.com/epel//6/x86_64/epel-release-6-8.noarch.rpmwarning: /var/tmp/rpm-tmp.IHCvEN: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEYPreparing... ########################################### [100%] 1:epel-release ########################################### [100%] |
|
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
|
[root@node-12 ~]# yum search collectdLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileepel/metalink | 5.7 kB 00:00 * base: mirrors.skyshe.cn * epel: mirrors.ustc.edu.cn * extras: mirrors.skyshe.cn * updates: mirrors.btte.netepel | 4.1 kB 00:00 epel/primary_db | 6.4 MB 00:06 ========================================================================================= N/S Matched: collectd ==========================================================================================collectd-apache.x86_64 : Apache plugin for collectdcollectd-dns.x86_64 : DNS traffic analysis module for collectdcollectd-email.x86_64 : Email plugin for collectdcollectd-ipmi.x86_64 : IPMI module for collectdcollectd-mysql.x86_64 : MySQL module for collectdcollectd-nginx.x86_64 : Nginx plugin for collectdcollectd-nut.x86_64 : Network UPS Tools module for collectdcollectd-ping.x86_64 : ping module for collectdcollectd-postgresql.x86_64 : PostgreSQL module for collectdcollectd-rrdtool.x86_64 : RRDTool module for collectdcollectd-sensors.x86_64 : Libsensors module for collectdcollectd-snmp.x86_64 : SNMP module for collectdcollectd-virt.x86_64 : Libvirt plugin for collectdfedmsg-collectd.noarch : A fedmsg plugin for collectdperl-Collectd.x86_64 : Perl bindings for collectdcollectd.i686 : Statistics collection daemon for filling RRD filescollectd.x86_64 : Statistics collection daemon for filling RRD filescollectd-web.x86_64 : Contrib web interface to viewing rrd filespython-bucky.noarch : CollectD and StatsD adapter for Graphite Name and summary matches only, use "search all" for everything.[root@node-12 ~]# |
可以知道已经有了我们需要的软件包。
安装collectd软件包
|
1
|
yum install collectd collect-* |
这里可能会有下面的错误:
|
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
|
--> Finished Dependency ResolutionError: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: perl-HTML-ParserError: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: perl(HTML::Entities)Error: Package: collectd-rrdtool-4.10.9-1.el6.x86_64 (epel) Requires: rrdtoolError: Package: collectd-ipmi-4.10.9-1.el6.x86_64 (epel) Requires: libOpenIPMIutils.so.0()(64bit)Error: Package: perl-Collectd-4.10.9-1.el6.x86_64 (epel) Requires: perl(RRDs)Error: Package: collectd-email-4.10.9-1.el6.x86_64 (epel) Requires: spamassassinError: Package: collectd-snmp-4.10.9-1.el6.x86_64 (epel) Requires: net-snmpError: Package: collectd-ipmi-4.10.9-1.el6.x86_64 (epel) Requires: libOpenIPMIpthread.so.0()(64bit)Error: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: perl(URI::Escape)Error: Package: collectd-ipmi-4.10.9-1.el6.x86_64 (epel) Requires: libOpenIPMI.so.0()(64bit)Error: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: perl(RRDs)Error: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: rrdtool-perlError: Package: collectd-web-4.10.9-1.el6.x86_64 (epel) Requires: perl(JSON)Error: Package: collectd-rrdtool-4.10.9-1.el6.x86_64 (epel) Requires: librrd_th.so.4()(64bit)Error: Package: perl-Collectd-4.10.9-1.el6.x86_64 (epel) Requires: perl(URI::Escape) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest |
表示缺少这方面的包,如果没有该错误,请跳过下面的解决办法。
|
1
|
Requires: perl(URI::Escape) |
表示perl程序没有URI::Escape包。 将其他标准版本的Centos的镜像里的/etc/yum.repo.d/Centos-Base.repo到这台新的计算节点。因为新的计算节点是使用的fuel-web的源,并且国内的163.sohu等源都不好用。 重新执行安装collectd-*程序正常。
验证collectd可用
编辑/etc/collectd.conf配置文件
|
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
|
#Hostname "localhost"FQDNLookup true#BaseDir "/usr/var/lib/collectd"#PIDFile "/usr/var/run/collectd.pid"#PluginDir "/usr/lib/collectd"#TypesDB "/usr/share/collectd/types.db"#Interval 10#Timeout 2#ReadThreads 5LoadPlugin syslogLoadPlugin cpuLoadPlugin diskLoadPlugin interfaceLoadPlugin loadLoadPlugin memoryLoadPlugin libvirt LoadPlugin network <Plugin libvirt> RefreshInterval 60 #Domain "name" #BlockDevice "name:device" #InterfaceDevice "name:interface" #IgnoreSelected false HostnameFormat "name"</Plugin><Plugin disk># Disk "/^[hs]d[a-f][0-9]?$/"# IgnoreSelected false</Plugin>#Include "/etc/collectd.d"<Plugin network> Server "172.17.46.3" "25826"# CacheTimeout 120# CacheFlush 900</Plugin> |
启动服务
|
1
|
service collectd start |