polkit启动失败_zabbix4.4 启动失败分析

polkit启动失败_zabbix4.4 启动失败分析zabbix是基于WEB界面提供分布式系统监视以及网络监视功能的企业级开源解决方案,能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。做为开源用户的支持者,我们大部分环境用的软件包含监控软件、数据库、继承应用、操作系统等都是用开源的,例如centos、PG、zabbix、openshift等,但是开源的在成熟度上是不错,但是安装软件有时比…

大家好,又见面了,我是你们的朋友全栈君。

zabbix是基于WEB界面提供分布式系统监视以及网络监视功能的企业级开源解决方案,能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。

做为开源用户的支持者,我们大部分环境用的软件包含监控软件、数据库、继承应用、操作系统等都是用开源的,例如centos、PG、zabbix、openshift等,但是开源的在成熟度上是不错,但是安装软件有时比较麻烦,例如centos的安全开关,默认情况下会导致我们在安装openshift、zabbix等导致失败,而错误日志提示往往与实际十万三千里,但是有经验的在安装完系统后会有意识性的去修改配置,避免不必要的问题,

如下问题:

在安装配置好zabbix后无法正常启动,原因是SELINUX设置问题导致启动失败,

故障分析:

[root@localhost zabbix]# systemctl start zabbix-server.service

Job for zabbix-server.service failed because a configured resource limit was exceeded. See “systemctl status zabbix-server.service” and “journalctl -xe” for details.

[root@localhost zabbix]# journalctl -xe

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit zabbix-server.service has begun starting up.

1月 07 15:21:17 localhost.localdomain systemd[1]: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.

1月 07 15:21:17 localhost.localdomain systemd[1]: zabbix-server.service never wrote its PID file. Failing.

1月 07 15:21:17 localhost.localdomain systemd[1]: Failed to start Zabbix Server.

— Subject: Unit zabbix-server.service has failed

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit zabbix-server.service has failed.

— The result is failed.

1月 07 15:21:17 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.

1月 07 15:21:17 localhost.localdomain systemd[1]: zabbix-server.service failed.

1月 07 15:21:17 localhost.localdomain polkitd[804]: Unregistered Authentication Agent for unix-process:6787:8831344 (system bus name

1月 07 15:21:24 localhost.localdomain polkitd[804]: Registered Authentication Agent for unix-process:6797:8832061 (system bus name :

1月 07 15:21:27 localhost.localdomain systemd[1]: zabbix-server.service holdoff time over, scheduling restart.

1月 07 15:21:27 localhost.localdomain systemd[1]: Starting Zabbix Server…

— Subject: Unit zabbix-server.service has begun start-up

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit zabbix-server.service has begun starting up.

1月 07 15:21:27 localhost.localdomain systemd[1]: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.

1月 07 15:21:27 localhost.localdomain systemd[1]: zabbix-server.service never wrote its PID file. Failing.

1月 07 15:21:27 localhost.localdomain systemd[1]: Failed to start Zabbix Server.

— Subject: Unit zabbix-server.service has failed

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit zabbix-server.service has failed.

— The result is failed.

1月 07 15:21:27 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.

1月 07 15:21:27 localhost.localdomain systemd[1]: zabbix-server.service failed.

1月 07 15:21:27 localhost.localdomain polkitd[804]: Unregistered Authentication Agent for unix-process:6797:8832061 (system bus name

lines 1907-1944/1944 (END)

Last login: Tue Jan 7 23:24:43 2020 from 10.100.81.67

查看 zabbix 日志分析:

发现日志提示权限问题:

5966:20200107:145500.376 using configuration file: /etc/zabbix/zabbix_server.conf

5966:20200107:145500.376 cannot set resource limit: [13] Permission denied

5966:20200107:145500.376 cannot disable core dump, exiting…

5976:20200107:145506.314 Starting Zabbix Server. Zabbix 4.4.4 (revision 3131fdac04

问题根源分析:

[root@localhost logs]# getenforce

Enforcing——这时发现selinux的配置是Enforcing

[root@localhost logs]# 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:      28

[root@localhost logs]# cd /etc/selinux

[root@localhost selinux]# ls

config  final  semanage.conf  targeted  tmp

直接把selinux 关掉如下:

[root@localhost selinux]# vi 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 three two values:

targeted – Targeted processes are protected,

minimum – Modification of targeted policy. Only selected processes are protected.

mls – Multi Level Security protection.

SELINUXTYPE=targeted

优化修改SELINUX=disabled

[root@localhost selinux]# vi 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 three two values:

#targeted – Targeted processes are protected,

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

#mls – Multi Level Security protection.

SELINUXTYPE=targeted

重新启动:

[root@localhost ~]# systemctl start zabbix-server.service

[root@localhost ~]# systemctl status zabbix-server.service

● zabbix-server.service – Zabbix Server

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

Active: active (running) since 二 2020-01-07 15:26:56 CST; 6s ago

Process: 1529 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)

Main PID: 1531 (zabbix_server)

CGroup: /system.slice/zabbix-server.service

└─1531 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf

1月 07 15:26:56 localhost.localdomain systemd[1]: Starting Zabbix Server…

1月 07 15:26:56 localhost.localdomain systemd[1]: zabbix-server.service: Supervising process 1531 which is not our child. …exits.

1月 07 15:26:56 localhost.localdomain systemd[1]: Started Zabbix Server.

Hint: Some lines were ellipsized, use -l to show in full.

[root@localhost ~]#

因此,一般在安装一些开源软件,如MYSQL、POSTGRES、zabbix、openshift等,在安装前先检查下系统对应版本是否与需安装的软件兼容性、在检查下下,防火墙、安全等是否开启,如下:

1、iptables开启和关闭

2、SELinux开启和关闭

3、CentOS 6和CentOS 7 firewalld防火墙的开与关等

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/151184.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 最长回文子串 python_最长回文子序列

    最长回文子串 python_最长回文子序列647.回文子串题目给定一个字符串,你的任务是计算这个字符串中有多少个回文子串。具有不同开始位置或结束位置的子串,即使是由相同的字符组成,也会被视作不同的子串。示例1:输入:”abc”输出:3解释:三个回文子串:”a”,”b”,”c”示例2:输入:”aaa”输出:6解释:6个回文子串:”a”,”a”,”a”,”aa”,”aa”,”aaa”提示:输入的字符串长度不会超过10…

    2022年10月16日
    3
  • AIC(最小信息化准则)

    AIC(最小信息化准则)AIC信息准则(即Akaikeinformationcriterion),是用来衡量统计模型拟合优良性的一个标准,是是由日本统计学家赤池弘次创立和发展的,因此也称为赤池信息量准则,它建立在熵的概念基础上,可以权衡所估计模型的复杂度和模型拟合数据的优良性。在一般情况下,AIC可以表示为:AIC=2k-2ln(L)其中:k是参数的数量,L是似然函数。假设条件是模型的误差服从独立正态分布。让n为观察…

    2022年5月22日
    71
  • Django(8)reverse函数「建议收藏」

    Django(8)reverse函数「建议收藏」reverse函数reverse函数的作用是用来进行URL反转的,接下来我们介绍reverse函数的几种用法之前我们都是通过url来访问视图函数。有时候我们知道这个视图函数,但是想反转回他的url

    2022年7月28日
    7
  • Hibernate二级缓存的使用「建议收藏」

    Hibernate二级缓存的使用「建议收藏」一、Hibernate共有两级缓存        Session级别缓存—-一级缓存(事务范围)        SessionFactory级别缓存—-二级缓存(进程范围) SessionFactory级别缓存        内置:Hibernate自带的,不可卸载.通常在Hibernate的初始化阶段,Hibernate会把映射

    2022年5月23日
    37
  • 28.多表查询——跨关联关系的多表查询

    28.多表查询——跨关联关系的多表查询多表查询—跨关联关系的查询**Django提供一种强大而又直观的方式来“处理”查询中的关联关系,它在后台自动帮你处理JOIN。若要跨越关联关系,只需使用关联的模型字段的名称,并使用双下划线分隔,直至你想要的字段:**上实战训练——更直观理解:(得到的都是QuerySet型数据!)fromdjango.httpimportHttpResponsefrom.modelsimportDepartment,Student,Course,Stu_detaildefadd_u

    2022年5月31日
    44
  • 将JSON数组转化为List集合[通俗易懂]

    将JSON数组转化为List集合[通俗易懂]假如我们向redis中存放了一个JSON数组,从中获取的时候需要将JSON数组转化为List集合,然后将List对象返回给前端。1.引入hutool和fastjson依赖<!–hutool–><dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId&gt

    2022年6月29日
    131

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号