无法运行mongod:致命断言28562

时间:2016-01-31 04:33:08

标签: mongodb installation

新手在这里学习node.js和mongodb。我正在尝试在我的Mac上安装mongodb,当我尝试在终端上运行mongod时遇到以下问题。

2016-01-31T12:08:39.791+0800 I CONTROL  [initandlisten] MongoDB starting :    pid=13733 port=27017 dbpath=/data/db 64-bit host=Joshuas-MBP
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] db version v3.2.1
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] allocator: system
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] modules: none
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] build environment:
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-01-31T12:08:39.792+0800 I CONTROL  [initandlisten] options: {}
2016-01-31T12:08:39.794+0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(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),
2016-01-31T12:08:47.249+0800 E STORAGE  [initandlisten] WiredTiger (22) [1454213327:242370][13733:0x7fff72b68000], WT_SESSION.create: 'table:_mdb_catalog' cannot be used until all column groups are created: Invalid argument
2016-01-31T12:08:47.259+0800 I -        [initandlisten] Fatal Assertion 28562
2016-01-31T12:08:47.259+0800 I -        [initandlisten] 

***aborting after fassert() failure

在查看文档和在线教程后,我基本上已经在终端上执行了以下操作来安装mongodb:

joshuatan ~ $ brew update
joshuatan ~ $ brew install mongodb
joshuatan ~ $ sudo mkdir -p /data/db
joshuatan ~ $ whoami
joshuatan
joshuatan ~ $ sudo chown joshuatan /data/db
joshuatan ~ $ mongod

我一直在google / stackoverflow中搜索,但无法找到任何遇到类似错误的帖子。

我错过了什么吗?非常感谢任何帮助/指导......谢谢

2 个答案:

答案 0 :(得分:1)

唯一对我有用的是(这是mac os)

rm -rf /tmp/mongodb-27017.soccd; cd /data/db;  rm -rf *;

然后只是mongod启动它

答案 1 :(得分:0)

如果您像我一样在Catalina上,看来可行的方法是使用{p>在data/db上创建正确放置的System/Volumes/Data/data/db

sudo mkdir -p /System/Volumes/Data/data/db
sudo chown -R `id -un` /System/Volumes/Data/data/db

然后,将该路径添加到mongod.conf(位于/usr/local/etc/mongod.conf上),在那里替换dbPath

...
storage:
  dbPath: /System/Volumes/Data/data/db
...

然后,重新启动它。如果您正在使用brew,请执行以下操作:

brew services restart mongodb-community

来源:https://zellwk.com/blog/install-mongodb/