Homebrew升级后无法运行MongoDB

时间:2019-07-10 15:53:22

标签: mongodb homebrew

我无意中通过Homebrew将MongoDB从3.6更新到4.0,我特别需要3.6。我手动卸载了4.0并安装了mongodb@3.6,但是现在,我在启动Shell和运行MongoDB时遇到了问题。这是我的日志:

2019-07-10T11:31:47.289-0400 I CONTROL  [initandlisten] MongoDB starting : pid=85532 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=Mac.local
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] db version v3.6.8
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] git version: 6bc9ed599c3fa164703346a22bad17e33fa913e4
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2s  28 May 2019
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] allocator: system
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] modules: none
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] build environment:
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten]     distarch: x86_64
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2019-07-10T11:31:47.290-0400 I CONTROL  [initandlisten] options: { config: "/usr/local/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/usr/local/var/mongodb" }, systemLog: { dest$
2019-07-10T11:31:47.292-0400 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=7680M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),ca$
2019-07-10T11:31:47.840-0400 I STORAGE  [initandlisten] WiredTiger message [1562772707:840661][85532:0x118fc75c0], txn-recover: Set global recovery timestamp: 0
2019-07-10T11:31:47.914-0400 I CONTROL  [initandlisten]
2019-07-10T11:31:47.914-0400 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-07-10T11:31:47.914-0400 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-07-10T11:31:47.914-0400 I CONTROL  [initandlisten]
2019-07-10T11:31:47.917-0400 I STORAGE  [initandlisten] createCollection: admin.system.version with provided UUID: 0be8a69d-eae6-4b63-be4d-52fc499eed68
2019-07-10T11:31:47.953-0400 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.6
2019-07-10T11:31:47.960-0400 I STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: 3269d14f-7da1-48c8-92ea-8f2674e8b64b
2019-07-10T11:31:47.993-0400 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/usr/local/var/mongodb/diagnostic.data'
2019-07-10T11:31:47.997-0400 I NETWORK  [initandlisten] waiting for connections on port 27017
2019-07-10T11:31:47.997-0400 I STORAGE  [LogicalSessionCacheRefresh] createCollection: config.system.sessions with generated UUID: 88eebffc-4972-4c4b-8ccc-a7e9d5e3580b
2019-07-10T11:31:48.042-0400 I INDEX    [LogicalSessionCacheRefresh] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions"$
2019-07-10T11:31:48.045-0400 I INDEX    [LogicalSessionCacheRefresh]     building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2019-07-10T11:31:48.052-0400 I INDEX    [LogicalSessionCacheRefresh] build index done.  scanned 0 total records. 0 secs
2019-07-10T11:33:00.672-0400 I CONTROL  [signalProcessingThread] got signal 2 (Interrupt: 2), will terminate after current cmd ends
2019-07-10T11:33:00.672-0400 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2019-07-10T11:33:00.672-0400 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2019-07-10T11:33:00.672-0400 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2019-07-10T11:33:00.673-0400 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2019-07-10T11:33:00.758-0400 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2019-07-10T11:33:00.761-0400 I CONTROL  [signalProcessingThread] now exiting
2019-07-10T11:33:00.761-0400 I CONTROL  [signalProcessingThread] shutting down with code:0

另一个线程建议我运行> db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } ),但是由于我现在为mongo命令获得了“找不到命令”,因此我无法运行该外壳程序。我是前端开发人员,因此不是MongoDB专家,但似乎mongodmongo命令不再链接,因此我必须手动运行/usr/local/opt/mongodb@3.6/bin/mongod。 / p>

我的问题是:

  1. 如何解决升级问题?
  2. 如何重新链接mongodmongo命令?
  3. 我应该从所有这些安装中清除所有剩余文件吗?

0 个答案:

没有答案