mongodb的壳蒙戈:每个套接字地址(协议/网络地址/端口)的一个使用通常是允许的。 对于插座

2019-08-17 06:25发布

这是罚款3天前,现在mongod不起作用。 即使echo ps -A | grep mongo 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>

Answer 1:

在命令提示输入以下命令

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

这将列出其使用端口“27017”与PID一起的所有进程。

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

taskkill /f /pid 10580

现在启动蒙戈。 希望这可以帮助。



Answer 2:

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

以确保您可以使用哪些端口,执行Sriukanth Venugopalan提到的命令,它会列出当前正在使用的端口。

问候,Moacy



Answer 3:

  1. 在打开命令提示Administrator模式
  2. 运行net stop MongoDB


文章来源: Mongodb shell mongo: Only one usage of each socket address (protocol/network address/port) is normally permitted. for socket: 0.0.0.0:27017