草庐IT

mongodb - 无法在 CentOS 7 上启动 MongoDB 3.2.1

coder 2023-11-01 原文

我按照这个文档在 CentOS 7 上安装了 MongoDB 3.2.1。安装后,我更改了 var/lib/mongovar/log/mongodb/mongod 的所有者和组.logroot:root

当我用 service mongod start 启动 mongodb 时,它只显示

Starting mongod (via systemctl):  Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.[FAILED]

我已经运行了两个命令来显示详细信息。

systemctl status mongod.service 显示

mongod.service - SYSV: Mongo is a scalable, document-oriented database.
   Loaded: loaded (/etc/rc.d/init.d/mongod)
   Active: failed (Result: exit-code) since Wen 2016-01-27 18:32:46 CST; 14s ago
  Process: 24913 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)
 Main PID: 23711 (code=exited, status=0/SUCCESS)

1月 27 18:32:45 server1 systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....
1月 27 18:32:45 server1 runuser[24920]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
1月 27 18:32:46 server1 mongod[24913]: Starting mongod: [FAILED]
1月 27 18:32:46 server1 systemd[1]: mongod.service: control process exited, code=exited status=1
1月 27 18:32:46 server1 systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
1月 27 18:32:46 server1 systemd[1]: Unit mongod.service entered failed state.

journalctl -xn 显示

-- Logs begin at 日 2016-01-24 16:33:05 CST, end at Wen 2016-01-27 18:32:46 CST. --
1月 27 18:32:15 server1 sshd[24879]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
1月 27 18:32:17 server1 sshd[24879]: Failed password for root from 182.100.67.59 port 10013 ssh2
1月 27 18:32:45 server1 sudo[24896]: root : TTY=pts/0 ; PWD=/var/log/mongodb ; USER=root ; COMMAND=/sbin/service mongod start
1月 27 18:32:45 server1 systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....
-- Subject: Unit mongod.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mongod.service has begun starting up.
1月 27 18:32:45 server1 runuser[24920]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
1月 27 18:32:46 server1 runuser[24920]: pam_unix(runuser:session): session closed for user mongod
1月 27 18:32:46 server1 mongod[24913]: Starting mongod: [FAILED]
1月 27 18:32:46 server1 systemd[1]: mongod.service: control process exited, code=exited status=1
1月 27 18:32:46 server1 systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mongod.service has failed.
-- 
-- The result is failed.
1月 27 18:32:46 server1 systemd[1]: Unit mongod.service entered failed state.

我使用 ssh key 访问服务器,没有密码。

最佳答案

是否有任何理由将所有权更改为 root?

/var/lib/mongo/var/log/mongodb 都应该是 mongodb 用户可写的。

默认是 mongodb:mongodb。在/etc/init.d/mongodb查看哪个用户运行了mongodb服务。如果它类似于 DAEMONUSER=${DAEMONUSER:-mongodb} 然后将您的目录返回给该用户。

关于mongodb - 无法在 CentOS 7 上启动 MongoDB 3.2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35035088/

有关mongodb - 无法在 CentOS 7 上启动 MongoDB 3.2.1的更多相关文章

  1. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  2. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  3. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  4. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  5. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  6. ruby-on-rails - 启动 Rails 服务器时 ImageMagick 的警告 - 2

    最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru

  7. ruby - 无法覆盖 irb 中的 to_s - 2

    我在pry中定义了一个函数:to_s,但我无法调用它。这个方法去哪里了,怎么调用?pry(main)>defto_spry(main)*'hello'pry(main)*endpry(main)>to_s=>"main"我的ruby版本是2.1.2看了一些答案和搜索后,我认为我得到了正确的答案:这个方法用在什么地方?在irb或pry中定义方法时,会转到Object.instance_methods[1]pry(main)>defto_s[1]pry(main)*'hello'[1]pry(main)*end=>:to_s[2]pry(main)>defhello[2]pry(main)

  8. ruby - 无法在 60 秒内获得稳定的 Firefox 连接 (127.0.0.1 :7055) - 2

    我使用的是Firefox版本36.0.1和Selenium-Webdrivergem版本2.45.0。我能够创建Firefox实例,但无法使用脚本继续进行进一步的操作无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055)错误。有人能帮帮我吗? 最佳答案 我遇到了同样的问题。降级到firefoxv33后一切正常。您可以找到旧版本here 关于ruby-无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055),我们在StackOverflow上找到一个类

  9. ruby - 安装 Ruby 时遇到问题(无法下载资源 "readline--patch") - 2

    当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub

  10. ruby-on-rails - 正确的 Rails 2.1 做事方式 - 2

    question的一些答案关于redirect_to让我想到了其他一些问题。基本上,我正在使用Rails2.1编写博客应用程序。我一直在尝试自己完成大部分工作(因为我对Rails有所了解),但在需要时会引用Internet上的教程和引用资料。我设法让一个简单的博客正常运行,然后我尝试添加评论。靠我自己,我设法让它进入了可以从script/console添加评论的阶段,但我无法让表单正常工作。我遵循的其中一个教程建议在帖子Controller中创建一个“评论”操作,以添加评论。我的问题是:这是“标准”方式吗?我的另一个问题的答案之一似乎暗示应该有一个CommentsController参

随机推荐