What Can I Do If the Port 27017 Is Already in Use When We Start Up the EAP Controller?
When we start up the EAP Controller, we may get the error report “port 27017 is already in use” as shown in the picture below:
The port 27017 is used for mongoDB server, an important module for EAP Controller. If the port 27017 is already occupied by some other applications or processes, the monogoDB cannot be initialed, and thus it will lead to the failure of the EAP Controller.
Generally, to solve this problem, we just need to find out the process that is using this port and stop this process. Please note that, before you do that, make sure this process is not important for you and can be stopped, or you may need use another host to run the EAP Controller.
Here are the steps to instruct you find out the process that occupy the specific port and then kill it on the Windows 7 operation system.
Step 1. Find the PID of the process that the port is using
Open the Command Line of the Windows operation system, and type the command netstat –ano |findstr “27017” as shown below:
Find the process whose status is LISTENING, and the 2700 is the PID of the process. Please note that different environment may have different result.
Step 2. Find the process’s name
Type the command tasklist |findstr “2700” as shown in the picture below. The 2700 is the PID that you found in the last step.
Here the result is mongod.exe, and this is in my test environment, you may get a different result.
Step 3. Kill the Process
Type the command taskkill /im mongod.exe /f as shown below.
Note: this command may require administrator operation permission. If so, please run the Command Line as an administrator.
After the process that occupy the port 27017 is killed successfully, it’s recommended to check it again with the command netstat –ano |findstr “27017”, after that, we can run the EAP Controller again.
Your feedback helps improve this site.