mongodb - Mongod 错误(随自制软件安装)

标签 mongodb

我已经安装了 mongodb

brew install mongodb

创建的文件夹

mkdir -p /data/db

处理权限

sudo chown -R `id -un` /data/db

运行

mongod    

错误日志

2018-01-06T14:28:51.450+0100 I CONTROL  [initandlisten] MongoDB starting : pid=6120 port=27017 dbpath=/data/db 64-bit host=Zigas-MBP-2
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] db version v3.6.1
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] git version: 025d4f4fe61efd1fb6f0005be20cb45a004093d1
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2n  7 Dec 2017
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] allocator: system
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] modules: none
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] build environment:
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-06T14:28:51.451+0100 I CONTROL  [initandlisten] options: {}
2018-01-06T14:28:51.452+0100 I -        [initandlisten] Detected data files in /data/db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2018-01-06T14:28:51.470+0100 I JOURNAL  [initandlisten] journal dir=/data/db/journal
2018-01-06T14:28:51.471+0100 I JOURNAL  [initandlisten] recover : no journal files present, no recovery needed
2018-01-06T14:28:51.494+0100 I JOURNAL  [durability] Durability thread started
2018-01-06T14:28:51.494+0100 I JOURNAL  [journal writer] Journal writer thread started
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten]
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten]
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          Remote systems will be unable toconnect to this server.
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-01-06T14:28:51.495+0100 I CONTROL  [initandlisten]
2018-01-06T14:28:51.762+0100 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
2018-01-06T14:28:51.762+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-06T14:28:51.763+0100 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-01-06T14:28:51.763+0100 I REPL     [initandlisten] shutdown: removing all drop-pending collections...
2018-01-06T14:28:51.763+0100 I REPL     [initandlisten] shutdown: removing checkpointTimestamp collection...
2018-01-06T14:28:51.763+0100 I STORAGE  [initandlisten] shutdown: waiting for fs preallocator...
2018-01-06T14:28:51.763+0100 I STORAGE  [initandlisten] shutdown: final commit...
2018-01-06T14:28:51.770+0100 I JOURNAL  [initandlisten] journalCleanup...
2018-01-06T14:28:51.770+0100 I JOURNAL  [initandlisten] removeJournalFiles
2018-01-06T14:28:51.770+0100 I JOURNAL  [initandlisten] old journal file will be removed: /data/db/journal/j._0
2018-01-06T14:28:51.771+0100 I JOURNAL  [initandlisten] Terminating durability thread ...
2018-01-06T14:28:51.870+0100 I JOURNAL  [journal writer] Journal writer thread stopped
2018-01-06T14:28:51.870+0100 I JOURNAL  [durability] Durability thread stopped
2018-01-06T14:28:51.870+0100 I STORAGE  [initandlisten] shutdown: closing all files...
2018-01-06T14:28:51.883+0100 I STORAGE  [initandlisten] closeAllFiles() finished
2018-01-06T14:28:51.883+0100 I STORAGE  [initandlisten] shutdown: removing fs lock...
2018-01-06T14:28:51.883+0100 I CONTROL  [initandlisten] now exiting
2018-01-06T14:28:51.883+0100 I CONTROL  [initandlisten] shutting down with code:62

如有任何帮助,将不胜感激。

最佳答案

2018-01-06T14:28:51.762+0100 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

这是您日志中的错误错误。

所以我猜你的 /data/db 中有一些 3.4 数据。

  1. 如果你想要一个干净的安装,只需删除 /data/db 的内容并重新启动 mongod

  1. 获取 3.4 的 mongod

引用:https://docs.mongodb.com/manual/release-notes/3.6-upgrade-standalone/

关于mongodb - Mongod 错误(随自制软件安装),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48127879/

相关文章:

java - 尝试插入 java 枚举时出现 mongodb 编解码器注册表错误

java - 使用 JPATest 和 MongoDB Test 为 Polyglot Springboot 编写测试

node.js - 使用 Express 设置 React Router

mongodb - 在 mongodb 中索引正在进行的事件还是我们需要一个 cron?

scala - 玩! framework 2.0 scala - ClassCastException : models. MyModel 无法转换为 models.MyModel

node.js - Mongoose:ObjectId 比较失败不一致

mongodb - 为什么空的 MongoDB 数据库这么大?

python - 使用 null 或不存在的属性解析 JSON

json - MongoDB:BSON 到 JSON

javascript - 在文档中查找、更新和返回数组对象 (mongodb)