zabbix-server启动失败处理方式

Zabbix服务器启动失败与SELinux关闭

错误重现

[root@ncayu101 data]# systemctl status zabbix-server 
● 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 四 2022-06-09 16:18:54 CST; 6s ago
  Process: 34789 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
  Process: 34768 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 34770 (code=exited, status=0/SUCCESS)

6月 09 16:18:54 ncayu101 kill[34789]: -q, --queue <sig>      use sigqueue(2) rather than kill(2)
6月 09 16:18:54 ncayu101 kill[34789]: -p, --pid              print pids without signaling them
6月 09 16:18:54 ncayu101 kill[34789]: -l, --list [=<signal>] list signal names, or convert one to a name
6月 09 16:18:54 ncayu101 kill[34789]: -L, --table            list signal names and numbers
6月 09 16:18:54 ncayu101 kill[34789]: -h, --help     display this help and exit
6月 09 16:18:54 ncayu101 kill[34789]: -V, --version  output version information and exit
6月 09 16:18:54 ncayu101 kill[34789]: For more details see kill(1).
6月 09 16:18:54 ncayu101 systemd[1]: zabbix-server.service: control process exited, code=exited status=1
6月 09 16:18:54 ncayu101 systemd[1]: Unit zabbix-server.service entered failed state.
6月 09 16:18:54 ncayu101 systemd[1]: zabbix-server.service failed.

在这里插入图片描述
看提示中提到SElinux,检查发现确实没有关闭SELinux

[root@ncayu101 data]# getenforce
Enforcing
[root@ncayu101 data]# 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:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

关闭SELinux

1.以root权限远程连接ECS实例。连接方式请参见连接方式概述。

2.运行命令getenforce,验证SELinux状态。
	返回状态如果是enforcing,表明SELinux已开启。

3.选择临时关闭或者永久关闭SELinux。
	执行命令setenforce 0临时关闭SELinux。
	永久关闭SElinux。
[root@ncayu101 data]# getenforce
Enforcing

# 临时关闭 SELinux
[root@ncayu101 data]# setenforce 0
[root@ncayu101 data]# 
[root@ncayu101 data]# 
[root@ncayu101 data]# getenforce
Permissive
  • a.运行以下命令,编辑SELinux的config文件。
    vim /etc/selinux/config
  • b.找到SELINUX=enforcing,按i进入编辑模式,将参数修改为SELINUX=disabled。
# 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=enforcing
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

我已经修改好了

在这里插入图片描述

  • c.修改完成后,按下键盘Esc键,执行命令:wq,保存并退出文件。

  • d.重启ECS实例。

shutdown -r now
  • e.重启后,运行命令getenforce,验证SELinux状态为disabled,表明SELinux已关闭。

启动zabbix

systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm

# Linux中查看
curl http://192.168.70.133/zabbix/setup.php

在这里插入图片描述

在浏览器中查看

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

会飞的土拨鼠呀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值