报错记录如下

[root@mongodb3 ~]# systemctl start mongod
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start mongod.service: Connection timed out
See system logs and 'systemctl status mongod.service' for details.
[root@mongodb3 ~]# systemctl status mongod.service
● mongod.service - SYSV: Mongo is a scalable, document-oriented database.Loaded: loaded (/etc/rc.d/init.d/mongod; bad; vendor preset: disabled)Active: inactive (dead)Docs: man:systemd-sysv-generator(8)
[root@mongodb3 ~]# systemctl start mongod
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start mongod.service: Connection timed out
See system logs and 'systemctl status mongod.service' for details.
[root@mongodb3 ~]# systemctl status polkit
● polkit.service - Authorization ManagerLoaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)Active: failed (Result: timeout) since Tue 2020-02-04 19:07:15 CST; 9h agoDocs: man:polkit(8)Process: 6867 ExecStart=/usr/lib/polkit-1/polkitd --no-debug (code=killed, signal=TERM)Main PID: 6867 (code=killed, signal=TERM)Feb 04 19:05:27 mongodb3 systemd[1]: Starting Authorization Manager...
Feb 04 19:05:29 mongodb3 polkitd[6867]: Started polkitd version 0.112
Feb 04 19:06:43 mongodb3 polkitd[6867]: Loading rules from directory /etc/polkit-1/rules.d
Feb 04 19:06:43 mongodb3 polkitd[6867]: Loading rules from directory /usr/share/polkit-1/rules.d
Feb 04 19:06:43 mongodb3 polkitd[6867]: Finished loading, compiling and executing 11 rules
Feb 04 19:06:43 mongodb3 polkitd[6867]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
Feb 04 19:07:15 mongodb3 systemd[1]: polkit.service start operation timed out. Terminating.
Feb 04 19:07:15 mongodb3 systemd[1]: Failed to start Authorization Manager.
Feb 04 19:07:15 mongodb3 systemd[1]: Unit polkit.service entered failed state.
Feb 04 19:07:15 mongodb3 systemd[1]: polkit.service failed.
[root@mongodb3 ~]# systemctl stop polkit
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to stop polkit.service: Connection timed out
See system logs and 'systemctl status polkit.service' for details.
Failed to get load state of polkit.service: Connection timed out

出现问题,就需要解决问题,不能较真的不断尝试…

1. /var/log/mongodb/mongod.log 日志中并没有先的日志产生

polkit 这个是什么服务?
参考网站
https://wiki.archlinux.org/index.php/Polkit_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
大概知道
polkit是linux服务器上的身份认证组件,目的是让用户证明自己属于某个用户组。更详细的内容,可以参考上面的网址。

经过百度,找到解决方法

PolicyKit failing to start with error: polkit.service: main process exited, code=exited, status=1/FAILURE

1.Ensure the existence of a polkitd system user & group
Copy/paste the following 2 compound-commands to a root terminal to check for and conditionally create the user/group

getent group polkitd >/dev/null && echo -e "\e[1;32mpolkitd group already exists\e[0m" || { groupadd -r polkitd && echo -e "\e[1;33mAdded missing polkitd group\e[0m" || echo -e "\e[1;31mAdding polkitd group FAILED\e[0m"; }
getent passwd polkitd >/dev/null && echo -e "\e[1;32mpolkitd user already exists\e[0m" || { useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd && echo -e "\e[1;33mAdded missing polkitd user\e[0m" || echo -e "\e[1;31mAdding polkitd user FAILED\e[0m"; }

2.Reset the permissions and user/group ownership for all files provided by the polkit and polkit-pkla-compat packages
Copy/paste the following compound-command to a root terminal to check for and conditionally reset user/group perms & ownership

rpm -Va polkit\* && echo -e "\e[1;32mpolkit* rpm verification passed\e[0m" || { echo -e "\e[1;33mResetting polkit* rpm user/group ownership & perms\e[0m"; rpm --setugids polkit polkit-pkla-compat; rpm --setperms polkit polkit-pkla-compat; }

3.Reboot
A reboot of the machine will be required to make sure that all changes take affect and that polkit has reconnected to the dbus

shutdown -r now

重启服务之后,启动mongod服务,启动正常


```bash
[root@mongodb3 ~]# systemctl start mongod                                                                                                                             [root@mongodb3 ~]# mongo --port 27017 -u "admin" -p "admin" --authenticationDatabase "admin"
MongoDB shell version: 3.2.22
connecting to: 127.0.0.1:27017/test
Server has startup warnings:
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten]
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten]
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten]
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2020-02-05T05:14:44.741+0800 I CONTROL  [initandlisten]
replSet:SECONDARY>

Centos7环境启动mongod报polkit服务启动失败相关推荐

  1. Centos7环境启动docker报polkit服务启动失败

    出现问题,就需要解决问题,不能较真的不断尝试- 1. /var/log/mongodb/mongod.log 日志中并没有先的日志产生 1 polkit 这个是什么服务? 参考网站 https://w ...

  2. VS调试 启动vs报错--未启动IIS

    VS调试 启动程序报错--未启动IIS Express Web服务 解决办法: 1.关闭VS. 2.删出项目文件下的".vs"文件. 3.重新启动解决方案. 4.编译,运行OK. ...

  3. 本地计算机t3服务服务启动后停止,T3服务启动后又停止了

    右击"我的电脑"-"管理"-"服务"-找到"用友通"服务,选"启动"的时候仍然提示错误:" ...

  4. polkit 重新安装_CentOS Linux 7.4中polkit服务启动失败

    错误描述: 最近新装系统后,需要安装ftp和chrony等软件,装包,修改配置文件后,启动服务时出现报错: Error getting authority:Eroor initializing aut ...

  5. polkit启动失败_CentOS Linux 7.4中polkit服务启动失败

    错误描述: 最近新装系统后,真机电脑需要安装ftp和chrony等软件,装包,修改配置文件后,启动服务时出现报错: Error getting authority:Eroor initializing ...

  6. CentOS Linux 7.4中polkit服务启动失败

    错误描述: 最近新装系统后,真机电脑需要安装ftp和chrony等软件,装包,修改配置文件后,启动服务时出现报错: Error getting authority:Eroor initializing ...

  7. windows 服务停止后无法启动,报:“服务正在启动或停止中,请稍后片刻再试一次”

    windows 服务正在启动或停止中,请稍后片刻再试一次 继续使用Windows管理器中的资源管理器,在Windows任务管理器中选择"性能",并选择"资源监视器&quo ...

  8. 无法启动mysqll1006_CentOS7下MySQL服务启动失败原因及解决方法

    在重启阿里的CentOS7服务器后,重启MySQL 出现错误 Starting mysqld (via systemctl): Job for mysqld.service failed becaus ...

  9. java启动监听器报错_tomcat启动,监听器错误 Error listenerStart,有人遇到没?

    3# 发表于:2016-08-11 10:51:34  IP:113.206.*.* 控制台报一大堆错误:nested exception is org.springframework.beans.f ...

  10. VS2017 启动调试报错无法启动程序 当前状态中非法

    昨天还可以使用,今天就莫名报了这个错误,百度了一下: 1. 第一种尝试方法是右击解决方案中的项目(图标有带球的),打开属性选择"WEB"选项,修改特定页为Home,结果还是报错. ...

最新文章

  1. java压缩解压缩类实例[转]
  2. 转:Tkinter教程之Text(2)篇
  3. ARM汇编语言实现peek()_ARM汇编之访问C语言结构体数据
  4. POJ1151(矩形切割入门题)
  5. linux php环境搭建 图文教程,linux php环境搭建教程
  6. Validform实时表单验证插件实例使用
  7. [深入学习Redis]RedisAPI的原子性分析
  8. sharedpreferences使用方法_Google 推荐在 MVVM 架构中使用 Kotlin Flow
  9. 重磅开源:TN文本分析语言
  10. java 获取mongodb的连接数
  11. Java实现智能对话机器人自动聊天+语音秒回
  12. Editplus从下载到使用
  13. vue实现lodop打印功能
  14. 全球与中国结肠水疗机市场深度研究分析报告
  15. 兔子数列规律怎么讲_神奇兔子数列
  16. 手机连接Eclipse连接不上
  17. PCF8563 时钟芯片驱动代码
  18. N76E003 串口接收字符串,完整输出
  19. php表格弄成隔两行变色,Excel表格实现隔行填充背景颜色的三种方法
  20. 如何判断List 集合和Map 集合是否为空

热门文章

  1. linux 硬件raid 坏道,Linux服务器磁盘坏道的修复过程
  2. Lenovo y50-70 黑苹果hackintosh 10.14.4 Mojave 更新后开机黑屏,引导失败,无法开机
  3. 【日常】CCB网上银行“云宠物”喂食自动化脚本
  4. 虚拟机到服务器丢包,虚拟机丢包问题排查处理
  5. 用聚宽数据排一排商誉雷(附结果)
  6. 什么是北京指标?什么是北京车牌?
  7. JDK7下载|JDK1.7下载可选择window版和linux版
  8. android里面的USB功能----Host模式
  9. 你会用计算机吗怎么写,你会用computer吗
  10. 优化 | 线性化:两个0-1变量相乘的线性化