首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改数据目录后无法启动MongoDB

更改数据目录后无法启动MongoDB
EN

Stack Overflow用户
提问于 2017-01-05 19:44:42
回答 1查看 894关注 0票数 2

我在以下链接的帮助下安装了:https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04

它在默认情况下运行良好。但是当我更改/etc/mongod.conf中的数据目录时

代码语言:javascript
复制
#From
dbPath: /var/lib/mongodb
#To
dbPath: /media/user/'Mounted Volume'/mongodb_data

我无法启动MongoDB。以下是错误消息

代码语言:javascript
复制
$mongo
MongoDB shell version: 3.2.11
connecting to: test
2017-01-06T00:57:01.472+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2017-01-06T00:57:01.472+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:229:14
@(connect):1:6

exception: connect failed

以下为状态

代码语言:javascript
复制
$ sudo systemctl status mongodb
 mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: 
Active: failed (Result: exit-code) since Fri 2017-01-06 00:56:40 IST; 7s ago
Process: 5735 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (cod
Main PID: 5735 (code=exited, status=100)

Jan 06 00:56:40 GL552VW systemd[1]: Started High-performance, schema-free docume
Jan 06 00:56:40 GL552VW systemd[1]: mongodb.service: Main process exited, code=e
Jan 06 00:56:40 GL552VW systemd[1]: mongodb.service: Unit entered failed state.
Jan 06 00:56:40 GL552VW systemd[1]: mongodb.service: Failed with result 'exit-co

我是MongoDB的新手。也许我错过了一些很简单的东西。

EN

回答 1

Stack Overflow用户

发布于 2017-01-05 22:28:13

来自MongoDB配置文件文档页面

官方MongoDB包中包含的Linux包init脚本取决于systemLog.pathstorage.dbpathprocessManagement.fork的特定值。如果在默认配置文件中修改了这些设置,则可能无法启动。

因此,如果在配置文件中修改这些属性,则很可能必须编写新的init脚本。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41493420

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档