我正在尝试在 centos VM 上安装 mongoDb,并关注了几个站点,例如 https://linuxize.com/post/how-to-install-mongodb-on-centos-7/,https://www.digitalocean.com/ community/tutorials/how-to-install-mongodb-on-centos-7 ,但在 Cli 中给出 mongod 命令时无法连接/进入 MongoDB。有人对此有任何想法吗?提前致谢。
输出mongod
:
-460f-4bb5-a5d7-0bbe48f3246a") }
2019-08-26T15:21:13.417+0530 I INDEX [initandlisten] index build: done building index _id_ on ns admin.system.version
2019-08-26T15:21:13.417+0530 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2019-08-26T15:21:13.417+0530 I COMMAND [initandlisten] setting featureCompatibilityVersion to 4.2
2019-08-26T15:21:13.421+0530 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2019-08-26T15:21:13.421+0530 I STORAGE [initandlisten] Flow Control is enabled on this deployment.
2019-08-26T15:21:13.422+0530 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2019-08-26T15:21:13.422+0530 I STORAGE [initandlisten] createCollection: local.startup_log with generated UUID: 660f8f2a-c6d0-4a0c-a4bb-0f975d1f207e and options: { c485760 }
2019-08-26T15:21:13.426+0530 I INDEX [initandlisten] index build: done building index _id_ on ns local.startup_log
2019-08-26T15:21:13.427+0530 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2019-08-26T15:21:13.427+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2019-08-26T15:21:13.428+0530 I SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
2019-08-26T15:21:13.428+0530 I NETWORK [initandlisten] Listening on /tmp/mongodb-27017.sock
2019-08-26T15:21:13.428+0530 I NETWORK [initandlisten] Listening on 127.0.0.1
2019-08-26T15:21:13.428+0530 I NETWORK [initandlisten] waiting for connections on port 27017
2019-08-26T15:21:13.428+0530 I CONTROL [LogicalSessionCacheReap] Sessions collection is not set up; waiting until next sessions reap interval: config.system.sessions
2019-08-26T15:21:13.429+0530 I STORAGE [LogicalSessionCacheRefresh] createCollection: config.system.sessions with provided UUID: 45ed25cc-1dbb-4f38-8333-cf36ae8bd473 UUID("45ed25cc-1dbb-4f38-8333-cf36ae8bd473") }
2019-08-26T15:21:13.433+0530 I INDEX [LogicalSessionCacheRefresh] index build: done building index _id_ on ns config.system.sessions
2019-08-26T15:21:13.438+0530 I INDEX [LogicalSessionCacheRefresh] index build: starting on config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lnfig.system.sessions", expireAfterSeconds: 1800 } using method: Hybrid
2019-08-26T15:21:13.439+0530 I INDEX [LogicalSessionCacheRefresh] build may temporarily use up to 500 megabytes of RAM
2019-08-26T15:21:13.439+0530 I INDEX [LogicalSessionCacheRefresh] index build: collection scan done. scanned 0 total records in 0 seconds
2019-08-26T15:21:13.439+0530 I INDEX [LogicalSessionCacheRefresh] index build: inserted 0 keys from external sorter into index in 0 seconds
2019-08-26T15:21:13.440+0530 I INDEX [LogicalSessionCacheRefresh] index build: done building index lsidTTLIndex on ns config.system.sessions
2019-08-26T15:26:13.428+0530 I SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
我不确定您实际上要做什么。运行将在您当前的 shell 中
mongod
启动一个 mongo服务器。如果你想连接到 MongoDB 服务器,你应该使用mongo
不清楚,但如果你已经
Marking collection...
从mongod
命令中到达,MongoDB 已经启动。要开始工作,请打开一个新的终端窗口,导航到您的 bin 文件夹并运行
mongo
. 我的部分困惑是它似乎挂起(在 bash 中),但事实并非如此。键入help
它应该可以工作。我有同样的问题。我正在尝试安装 mongo db。我调用 ./mongod 命令,安装无法完成。它挂在相同的命令上:
Mac OS Mojave 10.14 我的所有痕迹: