Mongodb无法启动 [英] Mongodb won't start

查看:96
本文介绍了Mongodb无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Mac Homebrew命令安装了MongoDB,但是当我运行mongod

I installed MongoDB using the Mac Homebrew command but when I run mongod

无法识别我的终端机:/

It's not recognized my my terminal :/

如果我键入export PATH=$PATH:/usr/local/mongodb/bin然后运行mongod,它将启动但很快退出

If I type in export PATH=$PATH:/usr/local/mongodb/bin then run mongod it starts up but quickly exits

mongod --help for help and startup options
Sun Jan 20 18:59:25 [initandlisten] MongoDB starting : pid=59800 port=27017 dbpath=/data/db/ 64-bit host=Kevin-Tucks-MacBook-Pro.local
Sun Jan 20 18:59:25 [initandlisten] db version v2.0.4, pdfile version 4.5
Sun Jan 20 18:59:25 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506cb21f8ebf
Sun Jan 20 18:59:25 [initandlisten] build info: Darwin erh2.10gen.cc 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Sun Jan 20 18:59:25 [initandlisten] options: {}
Sun Jan 20 18:59:25 [initandlisten] journal dir=/data/db/journal
Sun Jan 20 18:59:25 [initandlisten] recover : no journal files present, no recovery needed
Sun Jan 20 18:59:25 [initandlisten] preallocateIsFaster=true 2.38
Sun Jan 20 18:59:25 [websvr] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:28017
Sun Jan 20 18:59:25 [websvr] ERROR:   addr already in use
Sun Jan 20 18:59:25 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
Sun Jan 20 18:59:25 [initandlisten] ERROR:   addr already in use
Sun Jan 20 18:59:25 [initandlisten] now exiting
Sun Jan 20 18:59:25 dbexit: 
Sun Jan 20 18:59:25 [initandlisten] shutdown: going to close listening sockets...
Sun Jan 20 18:59:25 [initandlisten] shutdown: going to flush diaglog...
Sun Jan 20 18:59:25 [initandlisten] shutdown: going to close sockets...
Sun Jan 20 18:59:25 [initandlisten] shutdown: waiting for fs preallocator...
Sun Jan 20 18:59:25 [initandlisten] shutdown: lock for final commit...
Sun Jan 20 18:59:25 [initandlisten] shutdown: final commit...
Sun Jan 20 18:59:25 [initandlisten] shutdown: closing all files...
Sun Jan 20 18:59:25 [initandlisten] closeAllFiles() finished
Sun Jan 20 18:59:25 [initandlisten] journalCleanup...
Sun Jan 20 18:59:25 [initandlisten] removeJournalFiles
Sun Jan 20 18:59:25 [initandlisten] shutdown: removing fs lock...
Sun Jan 20 18:59:25 dbexit: really exiting now

我已经尝试重新启动Shell,但是如果我再次尝试运行mongod,它将以无法识别的形式返回,并要求我重新输入export PATH=$PATH:/usr/local/mongodb/bin.

I've tried restarting my shell but if I try to run mongod again, it comes back as unrecognised and requires me to retype in export PATH=$PATH:/usr/local/mongodb/bin.

推荐答案

Kyle:看来mongo已经在运行,或者另一个进程正在使用端口27017"

Kyle: "It looks like mongo is already running or another process is using port 27017"

在这种情况下,键入以下命令

In this case, type the following command

ps wuax | grep mongo

您应该会看到类似这样的东西

You should see something that looks like this

User           31936   0.5 0.4 2719784 35624   ?? S     7:34pm   0:09.98 mongod
User           31945   0.0 0.0 2423368   184 s000 R+   8:24pm   0:00.00 grep mongo

现在输入mongod实例的kill命令(在本例中为31936):

Now enter the kill command for the mongod instance (31936 in this case):

kill 31936

这篇关于Mongodb无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆