“地址已在使用中”码头工人组成时出错 [英] "Address already in use" error upon docker-compose up

查看:68
本文介绍了“地址已在使用中”码头工人组成时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 docker-compose up 启动多个Docker容器,但是我收到以下(部分)错误消息:



'pre> 重新创建1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_ipercroncompose_rabbitmq_1

错误:RabbitMQ的无法启动服务的RabbitMQ:驱动程序无法在端点ipercroncompose_rabbitmq_1(a8ded956e30b922289614bbbc4e4fb773c58688d395895b575a88b638592df94)编程外部连接:启动userland代理时出错:监听tcp 0.0.0.0:5672:绑定:地址已在使用中
错误:在启动项目时遇到错误。

https://github.com/docker/docker/issues/8714 ,我已经尝试过该命令

  netstat -pna | grep 5672 

导致

 (不是所有进程都可以被识别,非拥有的进程信息
不会显示,您必须是root用户才能看到全部。)
tcp 0 0 0.0。 0.0:25672 0.0.0.0:* LISTEN-
tcp6 0 0 ::: 5672 ::: * LISTEN-
unix 2 [] DGRAM 15672-

但是,我在这里看不到任何可以杀死的进程ID。任何想法导致此错误的原因是什么?

解决方案

跟随https://unix.stackexchange.com/questions/106561/finding-the-pid-of-the-process-使用一个特定端口,而不是 netstat ,我使用了 lsof -i

  kurt @ kurt-ThinkPad:〜$ sudo lsof -i:5672 | grep LISTEN 
[sudo] kurt密码:
beam.smp 953 rabbitmq 52u IPv6 33026 0t0 TCP *:amqp(LISTEN)

在运行 sudo kill 953 之后,我能够运行 docker-compose


I'm trying to start up several docker containers using docker-compose up, but I'm getting the following (partial) error message:

Recreating 1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_1faf02f5d67e_ipercroncompose_rabbitmq_1

ERROR: for rabbitmq  Cannot start service rabbitmq: driver failed programming external connectivity on endpoint ipercroncompose_rabbitmq_1 (a8ded956e30b922289614bbbc4e4fb773c58688d395895b575a88b638592df94): Error starting userland proxy: listen tcp 0.0.0.0:5672: bind: address already in use
ERROR: Encountered errors while bringing up the project.

Following a suggestion at https://github.com/docker/docker/issues/8714, I've tried the command

netstat -pna | grep 5672

resulting in

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::5672                 :::*                    LISTEN      -               
unix  2      [ ]         DGRAM                    15672    -    

However, I don't see any process IDs here that I could kill. Any ideas what is causing this error?

解决方案

Following https://unix.stackexchange.com/questions/106561/finding-the-pid-of-the-process-using-a-specific-port, instead of netstat I used lsof -i:

kurt@kurt-ThinkPad:~$ sudo lsof -i :5672 | grep LISTEN
[sudo] password for kurt: 
beam.smp 953 rabbitmq   52u  IPv6  33026      0t0  TCP *:amqp (LISTEN)

After running sudo kill 953, I was able to run the docker-compose up.

这篇关于“地址已在使用中”码头工人组成时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆