關於zabbix-server 卡死問題有幾種,可是在網上搜索都不是個人問題,寫個總結給各位若有遇到並解決在好不過。網絡
問題描述 框架
systemctl start zabbix-server.serivce 啓動無果,另開窗口查看日誌。spa
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). 日誌
發現日誌卡死在這就不在動了,檢查下服務是否還在。code
ps -ef | grep zabbix-server
root 22304 13466 0 19:48 pts/6 00:00:00 grep --color=auto zabbix-serverserver
發現並無,用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]