error log
2018-06-08T22:25:09.118+0800 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2018-06-08T22:25:09.118+0800 I CONTROL [initandlisten] now exiting
2018-06-08T22:25:09.118+0800 I CONTROL [initandlisten] shutting down with code:48
error cause
error, error log has been clear, ‘Address already in use’ has a process has been running in the port. So we’re going to find this process and turn it off.
PID(Process Identification) operating system refers to the Process Identification number. Each time the operating system opens a program, it creates a process ID, or PID. Each process has a unique PID number, which is assigned by the process runtime system and does not represent a dedicated process. The PID does not change the identifier at run time, but after the process terminates the PID identifier is retrieved by the system and may be assigned to the newly run program.
solution span> span> span> span> h1>
find the PID number that was run before mongo, turn it off, and re-enter the start command
songrenqingdeMacBook-Pro:bin songrenqing$ lsof -i :27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 61316 songrenqing 11u IPv4 0xacda8b230bc07883 0t0 TCP localhost:27017 (LISTEN)
songrenqingdeMacBook-Pro:bin songrenqing$ kill -9 61316
or use another process ID, previously 27017, now specify 27018, so there will be no conflict
mongod --port 27018
div>
Read More:
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Flutter SocketException: OS Error: No route to host, errno = 113, address = XXX
- Error: listen eadrinuse: address already in use
- How to solve oserror: [errno 98] address already in use and kill the python3 process
- Solution to the problem that listen TCP 0.0.0.0:3306: bind: address already in use port is occupied in Linux centos7
- docker Error creating default “bridge“ network: failed to allocate gateway Address already in use
- Package inputenc Error: Unicode character , (U+FFØC) (inputenc) not set up for use with L aTeX. See
- Error running ‘Tomcat 9‘: Address localhost:1099 is already in use
- What should be paid attention to in socket programming — bind socket error: address already in use
- Error: transport error 202: bind failed: address already in use
- [exception] address already in use: bind
- JMeter: java.net.bindexception: address already in use: connect solution
- Error starting userland proxy: listen TCP 0.0.0.0:9000: Listen: address already in use
- Eclipse port occupied( java.net.BindException : address already in use: bind) solution
- Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently
- After the vs2013 + OpenGL environment is set up, there is an error in running the first program
- Raspberry pie set up to run Python program automatically
- How to use dangerously set inner HTML in react
- Developing in Android java.net.SocketException : socket failed: eacces (permission denied) reported an error
- Some error occurred error: listen eaddinuse: address already in use 127.0.0.1:3000
songrenqingdeMacBook-Pro:bin songrenqing$ lsof -i :27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 61316 songrenqing 11u IPv4 0xacda8b230bc07883 0t0 TCP localhost:27017 (LISTEN)
songrenqingdeMacBook-Pro:bin songrenqing$ kill -9 61316
mongod --port 27018