【问题标题】:Mongo fails to start after Xenial upgradeXenial 升级后 Mongo 无法启动
【发布时间】:2019-02-17 02:14:56
【问题描述】:

我刚刚将我的 DigitalOcean droplet 从 Ubuntu 14.04 升级到 16.04,但现在我无法启动 mongodb。这是我在尝试启动服务时收到的错误:

# systemctl status mongod.service
● mongod.service
   Loaded: loaded (/etc/init.d/mongod; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-02-16 12:49:28 EST; 17s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3800 ExecStart=/etc/init.d/mongod start (code=exited, status=1/FAILURE)

Feb 16 12:49:28 anthony-calandra mongod[3800]: Rather than invoking init scripts through /etc/init.d, use the service(8)
Feb 16 12:49:28 anthony-calandra mongod[3800]: utility, e.g. service mongod start
Feb 16 12:49:28 anthony-calandra mongod[3800]: initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connec
Feb 16 12:49:28 anthony-calandra mongod[3800]: Since the script you are attempting to invoke has been converted to an
Feb 16 12:49:28 anthony-calandra mongod[3800]: Upstart job, you may also use the start(8) utility, e.g. start mongod
Feb 16 12:49:28 anthony-calandra mongod[3800]: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connecti
Feb 16 12:49:28 anthony-calandra systemd[1]: mongod.service: Control process exited, code=exited status=1
Feb 16 12:49:28 anthony-calandra systemd[1]: Failed to start mongod.service.
Feb 16 12:49:28 anthony-calandra systemd[1]: mongod.service: Unit entered failed state.
Feb 16 12:49:28 anthony-calandra systemd[1]: mongod.service: Failed with result 'exit-code'.

如果您需要更多信息,请告诉我。

【问题讨论】:

    标签: mongodb ubuntu


    【解决方案1】:

    解决了我的问题。我有一个奇怪的 mongo 安装,所以我删除了它:

    sudo apt-get purge mongodb-org*
    

    然后我按照这个教程安装最新的:https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04

    然后我遇到了错误消息:“无法启动 mongod.service:未找到单元 mongod.service”。结果发现该服务已被禁用,所以我遵循了本指南:https://stackoverflow.com/a/53553652/3229983

    服务看起来不错:

    # sudo systemctl status mongod
    ● mongod.service - High-performance, schema-free document-oriented database
       Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
       Active: active (running) since Sat 2019-02-16 13:08:19 EST; 7s ago
         Docs: https://docs.mongodb.org/manual
     Main PID: 5711 (mongod)
       CGroup: /system.slice/mongod.service
               └─5711 /usr/bin/mongod --quiet --config /etc/mongod.conf
    
    Feb 16 13:08:19 anthony-calandra systemd[1]: Started High-performance, schema-free document-oriented database.
    

    现在我的 webapp 运行了。

    【讨论】:

      猜你喜欢
      • 2017-07-04
      • 2016-11-05
      • 2018-02-19
      • 1970-01-01
      • 2012-11-02
      • 2015-07-13
      • 2023-01-28
      • 2018-03-24
      • 2015-10-26
      相关资源
      最近更新 更多