Zabbix agent启动报错:cannot create semaphore set
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
# systemctl start zabbix-agent
Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details.
# journalctl -xe
.....
-- Unit zabbix-agent.service has begun starting up.
Apr 07 18:53:25 EWB-DB systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) after start.
Apr 07 18:53:25 EWB-DB systemd[1]: zabbix-agent.service never wrote its PID file. Failing.
Apr 07 18:53:25 EWB-DB systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
# tail /var/log/zabbix/zabbix_agentd.log
zabbix_agentd [7015]: cannot open log: cannot create semaphore set: [28] No space left on device
zabbix_agentd [7023]: cannot open log: cannot create semaphore set: [28] No space left on device
报错原因:
共享内存信号量kernel.sem参数设置过小,把128修改为256即可正常启动。
#cat /proc/sys/kernel/sem
250 32000 100 128
# vim /proc/sys/kernel/sem
kernel.sem =250 32000 100 256
# sysctl -p /etc/sysctl.conf
参数含义:
上面的4个数据分别对应:SEMMSL、SEMMNS、SEMOPM、SEMMNI这四个核心参数,具体含义和配置如下。
SEMMSL:每个用户拥有信号量最大数量
SEMMNS:系统信号量最大数量
SEMOPM:每次semop系统调用操作数
SEMMNI:系统信号量集最大数量
参考: