Привет, у меня есть стек с rabbitmq и haproxy, когда я использую docker-compose, все в порядке, но когда я использую развертывание docker stack, я получаю следующую ошибку.
как я могу это исправить?
я попробовал следующее в etrypoint.sh, но оно не работает:
rabbitmqctl status --erlang-cookie `cat $HOME/.erlang.cookie`
cat /var/lib/rabbitmq/.erlang.cookie
echo `cat $HOME/.erlang.cookie` >> /var/lib/rabbitmq/.erlang.cookie
Warning: PID file not written; -detached was passed.
Status of node rabbit@rabbitmq3 ...
[{pid,432},
{running_applications,[{sasl,"SASL CXC 138 11","3.1.2"},
{stdlib,"ERTS CXC 138 10","3.4.5"},
{kernel,"ERTS CXC 138 10","5.4.3.2"}]},
{os,{unix,linux}},
{erlang_version,"Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:64] [hipe] [kernel-poll:true]\n"},
{memory,[{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,0},
{queue_slave_procs,0},
{plugins,0},
{other_proc,24460232},
{metrics,0},
{mgmt_db,0},
{mnesia,0},
{other_ets,874544},
{binary,105848},
{msg_index,0},
{code,5502720},
{atom,331273},
{other_system,17317207},
{allocated_unused,12094512},
{reserved_unallocated,1605632},
{strategy,rss},
{total,[{erlang,48591824},{rss,62291968},{allocated,60686336}]}]},
{alarms,[]},
{listeners,[]},
{vm_memory_calculation_strategy,rss},
{processes,[{limit,1048576},{used,41}]},
{run_queue,0},
{uptime,1},
{kernel,{net_ticktime,60}}]
MYJOEXMYGCHAKDWRCMYWStopping rabbit application on node rabbit@rabbitmq3 ...
Error: unable to perform an operation on node 'rabbit@rabbitmq3'. 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 http://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@rabbitmq3
DIAGNOSTICS
===========
attempted to contact: [rabbit@rabbitmq3]
rabbit@rabbitmq3:
* connected to epmd (port 4369) on rabbitmq3
* epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
* TCP connection succeeded but Erlang distribution failed
* Authentication failed (rejected by the remote node), please check the Erlang cookie
Current node details:
* node name: rabbitmqcli22@rabbitmq3
* effective user's home directory: /var/lib/rabbitmq
* Erlang cookie hash: 1B2M2Y8AsgTpgAmY7PhCfg==
У меня есть ENV с именем
RABBITMQ_ERLANG_COOKIE=12345
, и я передаю его в ENV в Dockerсоставьте как:
rabbitmq2:
image: rabbitmq:3-management
hostname: rabbitmq2
depends_on:
- rabbitmq1
environment:
- RABBITMQ_ERLANG_COOKIE=${RABBITMQ_ERLANG_COOKIE}
volumes:
- ./cluster-entrypoint.sh:/usr/local/bin/cluster-entrypoint.sh
entrypoint: /usr/local/bin/cluster-entrypoint.sh
используя этот библиотека https://github.com/pardahlman/docker-rabbitmq-cluster