14

前两天还好好的,现在mongod不行了。甚至echo ps -A | grep mongo什么也没打印,但它警告错误:“每个套接字地址只使用一次”。怎么杀那个?我也尝试过使用不同的随机端口。他们怎么会失败呢?

D:\mongodb-win32-x86_64-2.2.3\bin>mongod
mongod --help for help and startup options
Sun Mar 03 18:10:03 [initandlisten] MongoDB starting : pid=6292 port=27017 dbpat
h=\data\db\ 64-bit host=Sadaf
Sun Mar 03 18:10:03 [initandlisten] db version v2.2.3, pdfile version 4.5
Sun Mar 03 18:10:03 [initandlisten] git version: f570771a5d8a3846eb7586eaffcf4c2
f4a96bf08
Sun Mar 03 18:10:03 [initandlisten] build info: windows sys.getwindowsversion(ma
jor=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB
_VERSION=1_49
Sun Mar 03 18:10:03 [initandlisten] options: {}
Sun Mar 03 18:10:03 [initandlisten] journal dir=/data/db/journal
Sun Mar 03 18:10:03 [initandlisten] recover : no journal files present, no recov
ery needed
Sun Mar 03 18:10:04 [initandlisten] ERROR: listen(): bind() failed errno:10048 O
nly one usage of each socket address (protocol/network address/port) is normally
 permitted. for socket: 0.0.0.0:27017
Sun Mar 03 18:10:04 [websvr] ERROR: listen(): bind() failed errno:10048 Only one
 usage of each socket address (protocol/network address/port) is normally permit
ted. for socket: 0.0.0.0:28017
Sun Mar 03 18:10:04 [initandlisten] now exiting
Sun Mar 03 18:10:04 dbexit:
Sun Mar 03 18:10:04 [initandlisten] shutdown: going to close listening sockets..
.
Sun Mar 03 18:10:04 [initandlisten] shutdown: going to flush diaglog...
Sun Mar 03 18:10:04 [initandlisten] shutdown: going to close sockets...
Sun Mar 03 18:10:04 [initandlisten] shutdown: waiting for fs preallocator...
Sun Mar 03 18:10:04 [initandlisten] shutdown: lock for final commit...
Sun Mar 03 18:10:04 [initandlisten] shutdown: final commit...
Sun Mar 03 18:10:04 [initandlisten] shutdown: closing all files...
Sun Mar 03 18:10:04 [initandlisten] closeAllFiles() finished
Sun Mar 03 18:10:04 [initandlisten] journalCleanup...
Sun Mar 03 18:10:04 [initandlisten] removeJournalFiles
Sun Mar 03 18:10:04 [initandlisten] shutdown: removing fs lock...
Sun Mar 03 18:10:04 dbexit: really exiting now

D:\mongodb-win32-x86_64-2.2.3\bin>echo ps -A | grep mongo

D:\mongodb-win32-x86_64-2.2.3\bin>
4

3 回答 3

20

在命令提示符中键入以下命令

netstat -a -n -o | find "27017"

这将列出所有使用端口“27017”的进程以及 PID。

使用“27017”找到 PID。例如,如果 PID 是 10580,杀死它

taskkill /f /pid 10580

现在开始mongo。希望这可以帮助。

于 2017-04-18T09:47:01.213 回答
5

尝试在不同的端口上启动 mongo:http: //docs.mongodb.org/manual/reference/mongod/#cmdoption-mongod--port

要确定您可以使用哪个端口,请执行 Sriukanth Venugopalan 提到的命令,它将列出当前正在使用的端口。

问候, 莫西

于 2013-04-27T17:19:09.957 回答
4
  1. Administrator在模式下打开命令提示符
  2. net stop MongoDB
于 2017-07-05T10:35:56.670 回答