启动userland代理时出错:listen tcp 0.0.0.0:2049:bind:地址已在使用中

问题描述 投票:0回答:2

在Ubuntu 18.04上,我正在尝试安装Hyperledger Cello,在安装过程中,我得到:

make[2]: Entering directory '/home/julien/cello'
docker-compose -f bootup/docker-compose-files/docker-compose-nfs.yml up -d --no-recreate
WARNING: Found orphan containers (cello-user-dashboard, cello-operator-dashboard, cello-watchdog, cello-keycloak-server, cello-parse-server, cello-dashboard_rabbitmq, cello-mongo, cello-keycloak-mysql, cello-engine) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting cello-nfs ... error

ERROR: for cello-nfs  Cannot start service nfs: driver failed programming external connectivity on endpoint cello-nfs (d1be7a4999731983a12df9f1fb6484c7adf669be7edf01c6d962856ed8a6846f): Error starting userland proxy: listen tcp 0.0.0.0:2049: bind: address already in use

ERROR: for nfs  Cannot start service nfs: driver failed programming external connectivity on endpoint cello-nfs (d1be7a4999731983a12df9f1fb6484c7adf669be7edf01c6d962856ed8a6846f): Error starting userland proxy: listen tcp 0.0.0.0:2049: bind: address already in use
ERROR: Encountered errors while bringing up the project.

在试图找出哪个应用程序正在使用2049端口时,我这样做:

➜  cello git:(master) ✗ sudo netstat -pna | grep 2049
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::2049                 :::*                    LISTEN      -                   
udp        0      0 0.0.0.0:2049            0.0.0.0:*                           -                   
udp6       0      0 :::2049                 :::*                                -                   
unix  3      [ ]         STREAM     CONNECTED     204951   18122/brave --type=  
unix  3      [ ]         STREAM     CONNECTED     204950   5193/brave           

但我没有应用名称。

我也尝试用

docker rm -f $(docker ps -aq)

就像在this post所说,但它没有用。

我该怎么做才能释放这个端口?

docker ubuntu port bind
2个回答
2
投票

看起来好像您的主机上运行了NFS服务器。当您以root身份运行netstat -p ...并且没有看到端口的PID时,像这样...

tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::2049                 :::*                    LISTEN      -                   
udp        0      0 0.0.0.0:2049            0.0.0.0:*                           -                   
udp6       0      0 :::2049                 :::*                                -                   

...通常意味着有一个绑定到该端口的内核服务。禁用内核NFS服务器(假设您没有使用它)应该允许您运行容器。


2
投票

你可以试试 :

docker stop $(docker ps -a -q)
docker ps # again to make sure containers is off
sudo lsof -i tcp:2049 # now you get and list of process running and using 2049 port find and copy PID
sudo kill -9 yout_PID

既然2049端口被杀死了,那么再次尝试启动容器......

© www.soinside.com 2019 - 2024. All rights reserved.