docker - 启动用户态代理 : listen tcp 0. 0.0.0:2049 时出错:绑定(bind):地址已在使用中

标签 docker ubuntu port bind

在 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 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端口被杀死,然后尝试再次启动容器...

关于docker - 启动用户态代理 : listen tcp 0. 0.0.0:2049 时出错:绑定(bind):地址已在使用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55535967/

相关文章:

linux - `Cmake` 在调用 `target_link_libraries(target_name, library_name_without_postfix)` 时更喜欢链接到哪个库?

bash - 在 Linux 服务器/终端中压缩/扩展 Mp3 文件中的声音?

ubuntu - 在 Ubuntu 上卸载 Flink

tcp - 端口和 IP 地址 - 绑定(bind)是什么意思?

linux - 在 docker 中启动 tor

wordpress - Wordpress Docker容器无法连接到数据库容器

docker - 你应该在哪里存储你的 docker 配置文件?

http - 为什么一些互联网提供商关闭某些端口?

C#配置TCPClient客户端端口

swift - CircleCI Swift 与 Postgres 连接问题