zabbix-server卡死不动
关于zabbix-server 卡死问题有几种,但是在网上搜索都不是我的问题,写个总结给各位如有遇到并解决在好不过。
问题描述
systemctl start zabbix-server.serivce 启动无果,另开窗口查看日志。
tail -999f /var/log/zabbix/zabbix_server.log
12377:20190117:182738.777 [Z3001] connection to database 'zabbix' failed: [1040] Too many connections
12386:20190117:182738.777 [Z3001] connection to database 'zabbix' failed: [1040] Too many connections
12377:20190117:182738.777 Cannot connect to the database. Exiting...
12386:20190117:182738.777 Cannot connect to the database. Exiting...
12378:20190117:182738.778 [Z3001] connection to database 'zabbix' failed: [1040] Too many connections
12378:20190117:182738.778 Cannot connect to the database. Exiting...
12327:20190117:182738.779 One child process died (PID:12386,exitcode/signal:1). Exiting ...
zabbix_server [12327]: Error waiting for process with PID 12384: [4] Interrupted system call
zabbix_server [12327]: Error waiting for process with PID 12386: [10] No child processes
12327:20190117:182855.614 syncing history data...
12327:20190117:182855.614 syncing history data done
12327:20190117:182855.615 syncing trend data...
12327:20190117:182855.615 syncing trend data done
12327:20190117:182855.615 Zabbix Server stopped. Zabbix 4.0.0rc3 (revision 85283).
发现日志卡死在这就不在动了,检查下服务是否还在。
ps -ef | grep zabbix-server
root 22304 13466 0 19:48 pts/6 00:00:00 grep --color=auto zabbix-server
发现并没有,用status命令检查下看看状态
systemctl status zabbix-server.service
● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: deactivating (final-sigterm) since 四 2019-01-17 18:28:55 CST; 1h 23min ago
Process: 14797 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 12316 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 12327 (code=exited, status=0/SUCCESS)
Tasks: 1
CGroup: /system.slice/zabbix-server.service
└─12384 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
1月 17 18:27:38 server1 systemd[1]: Starting Zabbix Server...
1月 17 18:27:38 server1 systemd[1]: Started Zabbix Server.
1月 17 18:28:55 server1 systemd[1]: Stopping Zabbix Server...
确实是不在,但是为什么会启动不了,百思不得其解, 最后我发现 CGroup 下进程号对应对是启动命令,于是我百度了下CGgroup百度文章是这样说的。
systemctl status zabbix-server.service
● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since 四 2019-01-17 19:53:10 CST; 4s ago
Process: 14797 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 33547 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 33555 (zabbix_server)
Tasks: 69
CGroup: /system.slice/zabbix-server.service
├─33555 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
├─33556 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for processes]
├─33557 /usr/sbin/zabbix_server: alerter #1 started
├─33558 /usr/sbin/zabbix_server: alerter #2 started
├─33559 /usr/sbin/zabbix_server: alerter #3 started
├─33561 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]