监控流程:
Collectd ——> carbonrelay ——> carboncache2 ——> grafana
问题:合服后监控一个不存在的进程,监控一直报警,carboncache下的配置删除后重新自动生成
原因:collectd 没有真正停止,一直在发送缓存数据
解决办法:停止机器上的collectd服务,删除graphite数据
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
| [root@ip collectd.d]# /etc/init.d/collectd stop Stopping collectd: [ OK ] [root@ip collectd.d]# ps axu | grep coll zabbix 3786 0.0 0.0 119276 1720 ? S Oct10 15:41 /usr/sbin/zabbix_agentd: collector [idle 1 sec] root 21881 0.0 0.0 774200 1636 ? Ssl Oct10 60:44 collectd root 22110 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22111 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22122 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22168 0.0 0.0 4344 264 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22172 0.0 0.0 774200 2888 ? Sl Oct10 76:50 /usr/sbin/collectd -C /etc/collectd.conf -f root 22176 0.0 0.0 774200 2812 ? Sl Oct10 76:02 /usr/sbin/collectd -C /etc/collectd.conf -f root 22204 0.0 0.0 774200 2868 ? Sl Oct10 70:57 /usr/sbin/collectd -C /etc/collectd.conf -f root 22234 0.0 0.0 774200 2848 ? Sl Oct10 72:51 /usr/sbin/collectd -C /etc/collectd.conf -f [root@ip collectd.d]# /etc/init.d/collectd stop Stopping collectd: [FAILED] [root@ip collectd.d]# [root@ip collectd.d]# ps axu | grep coll zabbix 3786 0.0 0.0 119276 1720 ? S Oct10 15:41 /usr/sbin/zabbix_agentd: collector [idle 1 sec] root 4648 0.0 0.0 110460 856 pts/0 S+ 01:34 0:00 grep coll root 21881 0.0 0.0 774200 1636 ? Ssl Oct10 60:44 collectd root 22110 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22111 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22122 0.0 0.0 4344 260 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22168 0.0 0.0 4344 264 ? Ss Oct10 0:00 collectdmon -P /var/run/collectdmon.pid -c /usr/sbin/collectd -- -C /etc/collectd.conf root 22172 0.0 0.0 774200 2888 ? Sl Oct10 76:50 /usr/sbin/collectd -C /etc/collectd.conf -f root 22176 0.0 0.0 774200 2812 ? Sl Oct10 76:02 /usr/sbin/collectd -C /etc/collectd.conf -f root 22204 0.0 0.0 774200 2868 ? Sl Oct10 70:57 /usr/sbin/collectd -C /etc/collectd.conf -f root 22234 0.0 0.0 774200 2848 ? Sl Oct10 72:51 /usr/sbin/collectd -C /etc/collectd.conf -f [root@ip collectd.d]# ps axu | grep coll |awk '{print $2}' | xargs kill -9 kill: sending signal to 4650 failed: No such process [root@ip collectd.d]# ps axu | grep coll root 4656 0.0 0.0 110460 856 pts/0 S+ 01:34 0:00 grep coll
|
####记collectd插件
线上数据库压力比较大,导致玩家掉线,故需要一个可以监控到连接数的图表,collectd刚好有这个插件,监控某一个端口的TCP连接数
添加一个端口连接数的配置文件,(还需要将collectd.conf配置文件中的tcpconns插件打开)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| 监控单个端口: [root@ip collectd.d]# cat ardb_port.conf <Plugin "tcpconns"> ListeningPorts false LocalPort "16379" RemotePort "16379" </Plugin>
监控多个端口: [root@ip collectd.d]# cat ardb_tcpconns.conf <Plugin "tcpconns"> ListeningPorts false LocalPort "16379" LocalPort "6379" </Plugin>
|
解决collectd监控redis数据库获取redis info问题
1 2
| collectd监控redis的信息需要装额外的Python插件,安装了插件后查看会有Python模块,不装这个插件会报错 # yum install collectd-python.x86_64
|

1
| 下载redis Python插件到plugins目录下,Python插件地址:https://github.com/powdahound/redis-collectd-plugin
|
