无法使用brew服务启动mongodb - 中止陷阱:6

时间:2017-08-18 01:55:17

标签: mongodb macos homebrew

我刚刚使用brew install mongodb重新安装了mongodb。没有配置文件mongod运行它运行正常。但是,如果我指定默认配置文件,则会出错。

$ mongod --config /usr/local/etc/mongod.conf
Abort trap: 6

brew服务不起作用

$ brew services restart mongodb
Stopping `mongodb`... (might take a while)
==> Successfully stopped `mongodb` (label: homebrew.mxcl.mongodb)
==> Successfully started `mongodb` (label: homebrew.mxcl.mongodb)
$ brew services list
mongodb started ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

started为黄色。我有其他服务在运行,started是绿色

文件

两者都是brew生成的默认值:

/usr/local/etc/mongod.conf

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1

~Library/LaunchAgents/homebrew.mxcl.mongodb.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>homebrew.mxcl.mongodb</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/mongodb/bin/mongod</string>
    <string>--config</string>
    <string>/usr/local/etc/mongod.conf</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <false/>
  <key>WorkingDirectory</key>
  <string>/usr/local</string>
  <key>StandardErrorPath</key>
  <string>/usr/local/var/log/mongodb/output.log</string>
  <key>StandardOutPath</key>
  <string>/usr/local/var/log/mongodb/output.log</string>
  <key>HardResourceLimits</key>
  <dict>
    <key>NumberOfFiles</key>
    <integer>4096</integer>
  </dict>
  <key>SoftResourceLimits</key>
  <dict>
    <key>NumberOfFiles</key>
    <integer>4096</integer>
  </dict>
</dict>
</plist>

日志文件:

[main] ***** SERVER RESTARTED *****
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] MongoDB starting : pid=25338 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=StarkTower
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] db version v3.4.7
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] git version: cf38c1b8a0a8dca4a11737581beafef4fe120bcd
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2l  25 May 2017
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] allocator: system
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] modules: none
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] build environment:
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten]     distarch: x86_64
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2017-08-17T22:09:28.961-0400 I CONTROL  [initandlisten] options: { config: "/usr/local/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/usr/local/var/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/usr/local/var/log/mongodb/mongo.log" } }
2017-08-17T22:09:28.961-0400 I -        [initandlisten] Detected data files in /usr/local/var/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-08-17T22:09:28.961-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),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-08-17T22:09:29.720-0400 E STORAGE  [initandlisten] WiredTiger error (-31802) [1503022169:720091][25338:0x7fffd39fa3c0], file:sizeStorer.wt, WT_SESSION.open_cursor: unable to read root page from file:sizeStorer.wt: WT_ERROR: non-specific WiredTiger error
2017-08-17T22:09:29.721-0400 I -        [initandlisten] Invariant failure: ret resulted in status UnknownError: -31802: WT_ERROR: non-specific WiredTiger error at src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp 69
2017-08-17T22:09:29.721-0400 I -        [initandlisten] 

***aborting after invariant() failure


2017-08-17T22:09:29.738-0400 F -        [initandlisten] Got signal: 6 (Abort trap: 6).

0 个答案:

没有答案