简体   繁体   English

MongoDB-关闭失败,每个套接字地址只能使用一种

[英]MongoDB - shutting down by failed Only one usage of each socket address

Hii I'm Beginner in MEAN Stack Development I'm not getting connected with server Hii我是MEAN Stack开发的初学者,我没有与服务器建立连接

c:\MongoDB\bin>mongod
2017-11-09T20:28:32.450+0530 I CONTROL  [initandlisten] MongoDB starting : pid=1004 port=27017 dbpath=c:\data\db\ 64-bit host=Krishna-PC
2017-11-09T20:28:32.450+0530 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-11-09T20:28:32.451+0530 I CONTROL  [initandlisten] db version v3.4.10
2017-11-09T20:28:32.451+0530 I CONTROL  [initandlisten] git version: 078f28920cb24de0dd479b5ea6c66c644f6326e9
2017-11-09T20:28:32.452+0530 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2017-11-09T20:28:32.456+0530 I CONTROL  [initandlisten] allocator: tcmalloc
2017-11-09T20:28:32.458+0530 I CONTROL  [initandlisten] modules: none
2017-11-09T20:28:32.460+0530 I CONTROL  [initandlisten] build environment:
2017-11-09T20:28:32.460+0530 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2017-11-09T20:28:32.460+0530 I CONTROL  [initandlisten]     distarch: x86_64
2017-11-09T20:28:32.461+0530 I CONTROL  [initandlisten]     target_arch: x86_64
2017-11-09T20:28:32.461+0530 I CONTROL  [initandlisten] options: {}
2017-11-09T20:28:32.463+0530 E NETWORK  [initandlisten] listen(): bind() failed Only one usage of each socket address (protocol/network address/por
t) is normally permitted. for socket: 0.0.0.0:27017
2017-11-09T20:28:32.463+0530 E NETWORK  [initandlisten] Failed to set up sockets during startup.
2017-11-09T20:28:32.470+0530 E STORAGE  [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
2017-11-09T20:28:32.475+0530 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2017-11-09T20:28:32.477+0530 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2017-11-09T20:28:32.477+0530 I CONTROL  [initandlisten] now exiting
2017-11-09T20:28:32.477+0530 I CONTROL  [initandlisten] shutting down with code:48
D:\project>nodemon server.js
[nodemon] 1.12.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
(node:4860) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using
`connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
Server is Running on 3000

I'm trying build a project Please support Thank in advance 我正在尝试建立一个项目,请支持。

Based on : 基于 :

2017-11-09T20:28:32.463+0530 E NETWORK  [initandlisten] listen(): bind() failed Only one usage of each socket address (protocol/network address/por
t) is normally permitted. for socket: 0.0.0.0:27017

Problem 问题

Your MongoDB database is already started on port 27017 or you have another process on your server using the MongoDB port 27017 . 您的MongoDB数据库已在端口27017上启动,或者您在服务器上使用MongoDB端口27017另一个进程。

Solution

If the port 27017 is already used by another process, you can change the port when you start your MongoDB database. 如果端口27017已被另一个进程使用,则可以在启动MongoDB数据库时更改端口。

You can check the documentation : https://docs.mongodb.com/manual/reference/program/mongod/#cmdoption-port 您可以查看文档: https : //docs.mongodb.com/manual/reference/program/mongod/#cmdoption-port

 --port <port> 

Default: 27017 默认值:27017

Specifies the TCP port on which the MongoDB instance listens for client connections. 指定MongoDB实例在其上侦听客户端连接的TCP端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM