所以我对docker compose和rabbitmq。
我负责整理码头。一切都运转起来了。Docker组成:
services:
rabbitmq3:
image: "rabbitmq:3-management"
hostname: "localhost"
command: rabbitmq-server
ports:
- 5672:5672
- 15672:15672
然后我执行sudo rabbitmqctl status
以检查与节点的连接。我得到这个错误:
Error: unable to perform an operation on node 'rabbit@localhost'. Please see diagnostics information and suggestions below.
Most common reasons for this are:
* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
* Target node is not running
In addition to the diagnostics info below:
* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@localhost
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: [rabbit@localhost]
rabbit@localhost:
* connected to epmd (port 4369) on localhost
* epmd reports: node 'rabbit' not running at all
no other nodes on localhost
* suggestion: start the node
Current node details:
* node name: 'rabbitmqcli-25456-rabbit@localhost'
* effective user's home directory: /Users/olof.grund
* Erlang cookie hash: d1oONiVA/qogGxkf6vs9Rw==
当我在容器docker-compose exec -T rabbitmq3 rabbitmqctl status
中执行此操作时,它起作用。
我需要以某种方式揭露docker的东西吗?可能是某个rabbitmq-客户端或节点?
我使用了在其他来源中找到的所有技巧。(将IP添加到/etc/hosts/,重新启动容器和服务(。我花了一天的时间才终于把它发挥作用,归根结底就是这样。
<wait for 60secs since the rabbit container has been started>
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl force_boot
rabbitmqctl start_app
Rabbitmq使用Erlang的分发协议,该协议要求为EPMD打开端口4369(Erlang port Mapper Daemon(,在docker compose中公开它,并停止主机中运行的EPMD。