美文网首页
zabbix 4.4 初始化启动zabbix-server失败

zabbix 4.4 初始化启动zabbix-server失败

作者: vynson | 来源:发表于2019-12-11 13:34 被阅读0次

    --初始化配置完成之后,启动server与agent相关进程,报错server启动失败

    [root@king php-fpm.d]# systemctl restart zabbix-server zabbix-agent httpd php-fpm

    Job for zabbix-server.service failed because the control process exited with error code.

    See "systemctl status zabbix-server.service" and "journalctl -xe" for details.

    --根据提示查看相关信息 

    [root@king php-fpm.d]# systemctl status zabbix-server.service

    zabbix-server.service - Zabbix Server

      Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)

      Active: activating (auto-restart) (Result: exit-code) since Wed 2019-12-11 10:40:15 CST; 4s ago

      Process: 13431 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE)

    Dec 11 10:40:15 king systemd[1]: zabbix-server.service: Control process exited, code=exited status=1

    Dec 11 10:40:15 king systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

    Dec 11 10:40:15 king systemd[1]: Failed to start Zabbix Server.

    [root@king ~]# journalctl -xe

    ……

    Dec 11 11:13:20 king systemd[1]: zabbix-server.service: Service RestartSec=10s expired, scheduling restart.

    Dec 11 11:13:20 king systemd[1]: zabbix-server.service: Scheduled restart job, restart counter is at 520.

    ……

    Dec 11 11:13:21 king zabbix_server[15572]: zabbix_server [15572]: Cannot initialize IPC services: Cannot access path "/var/run/zabbix": [13] Permission denied.

    【这里提示访问/var/run/zabbix拒绝,不能初始化IPC服务;查看配置信息,这个文件下是存放进程socket、进程号ID相关文件。看到这里大概明白可能是由于selinux导致,selinux是将程序访问资源限制在访问规则当中,由规则决定程序进程是否有对访问资源的访问权限。

    ### Option: PidFile

    #      Name of PID file.

    #

    # Mandatory: no

    # Default:

    # PidFile=/tmp/zabbix_server.pid

    PidFile=/var/run/zabbix/zabbix_server.pid

    ### Option: SocketDir

    #      IPC socket directory.

    #              Directory to store IPC sockets used by internal Zabbix services.

    #

    # Mandatory: no

    # Default:

    # SocketDir=/tmp

    SocketDir=/var/run/zabbix】

    Dec 11 11:13:21 king systemd[1]: zabbix-server.service: Control process exited, code=exited status=1

    Dec 11 11:13:21 king systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

    Dec 11 11:13:21 king systemd[1]: Failed to start Zabbix Server.

    Dec 11 11:13:21 king setroubleshoot[14860]: SELinux is preventing /usr/sbin/zabbix_server_mysql from using the dac_override capability. For complete SELinux messages run: sealert -l 04fd5e32-168c-4e13-9bf1-b29fb7e2e8a3

    Dec 11 11:13:21 king platform-python[14860]: SELinux is preventing /usr/sbin/zabbix_server_mysql from using the dac_override capability.

    ……

    [root@king ~]# getenforce

    Enforcing

    [root@king ~]# sestatus

    SELinux status:                enabled

    SELinuxfs mount:                /sys/fs/selinux

    SELinux root directory:        /etc/selinux

    Loaded policy name:            targeted

    Current mode:                  enforcing

    Mode from config file:          disabled

    Policy MLS status:              enabled

    Policy deny_unknown status:    allowed

    Memory protection checking:    actual (secure)

    Max kernel policy version:      31

    --修改selinux为disabled

    [root@king ~]# more /etc/selinux/config

    # This file controls the state of SELinux on the system.

    # SELINUX= can take one of these three values:

    #    enforcing - SELinux security policy is enforced.

    #    permissive - SELinux prints warnings instead of enforcing.

    #    disabled - No SELinux policy is loaded.

    SELINUX=disabled

    # SELINUXTYPE= can take one of these three values:

    #    targeted - Targeted processes are protected,

    #    minimum - Modification of targeted policy. Only selected processes are protected.

    #    mls - Multi Level Security protection.

    SELINUXTYPE=targeted

    [root@king ~]# sestatus

    SELinux status:                disabled

    --重新启动zabbix-server服务,重新启动正常

    [root@king ~]# systemctl start zabbix-server

    相关文章

      网友评论

          本文标题:zabbix 4.4 初始化启动zabbix-server失败

          本文链接:https://www.haomeiwen.com/subject/uspogctx.html