1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| # 在相同網段下指定hostname以利叢集練線設定用 docker run -d --network rmq --hostname rabbit1 --name rabbit1 -e RABBITMQ_ERLANG_COOKIE='rabbitcookie' -p 15672:15672 -p 5672:5672 rabbitmq:3.7-management docker run -d --network rmq --hostname rabbit2 --name rabbit2 -e RABBITMQ_ERLANG_COOKIE='rabbitcookie' -p 5673:5672 rabbitmq:3.7-management docker run -d --network rmq --hostname rabbit3 --name rabbit3 -e RABBITMQ_ERLANG_COOKIE='rabbitcookie' -p 5674:5672 rabbitmq:3.7-management
# rabbit1設定 docker exec -it rabbit1 bash rabbitmqctl stop_app rabbitmqctl reset rabbitmqctl start_app
# rabbit2, rabbit3設定連線至rabbit1做叢集 rabbitmqctl stop_app rabbitmqctl reset rabbitmqctl join_cluster --ram rabbit@rabbit1 rabbitmqctl start_app
|