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:
- Port 4200 is already in use.Use ‘-port’ to specify a different port error Reasons
- Error: child process failed, exited with error number 1
- Mongodb start error: child process failed, exited with error number 1
- Mongodb failed to start: child process failed, exited with error number 100
- Oracle stops a job
- Solutions to the problem of “there are stopped jobs” in Linux
- socket.error : [errno 10048] and view PID process number and port number
- The solution to the error of [Oracle] ora-00054
- The GPU is still occupied after the program stops
- Error: Could not fork child process: There are no available terminals (-1).
- Through PID (process identification) to find the port (port) occupied applications, to solve the problem of port occupied
- Mongodb — startup exception, error report ERROR:NUMBER 100
- Linux c running error killed
- MongoDB Error: Failed to start mongod.service: Unit mongod.service is not loaded properly
- You must restart ADB and eclipse
- Deploy mongodb fragment combined with replica set to realize distributed storage of MySQL database files (step 10)
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- linux tomcat Run (DWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugIni)
- Allegro’s solution to “symbol is missing a refdes”
- ninja Compiling the C compiler identification source file CMakeCCompilerId.c failed
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