The Fly toml configuration:
# fly.toml app configuration file generated for rabbitmq-dv on 2024-10-18T23:35:59+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'rabbitmq-dv'
primary_region = 'cdg'
[build]
image = 'registry.fly.io/rabbitmq-dv:latest'
[[services]]
protocol = 'tcp'
internal_port = 5672
ports = []
auto_stop_machines = "off"
auto_start_machines = true
min_machines_running = 0
[[services.tcp_checks]]
interval = '15s'
timeout = '1m0s'
grace_period = '1s'
[[services]]
protocol = 'tcp'
internal_port = 15672
auto_stop_machines = "off"
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = 15672
handlers = ['tls', 'http']
[[services.tcp_checks]]
interval = '15s'
timeout = '1m0s'
grace_period = '1s'
[[services]]
protocol = 'tcp'
internal_port = 4369
auto_stop_machines = "off"
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = 4369
handlers = ['tls']
[[services.tcp_checks]]
interval = '15s'
timeout = '1m0s'
grace_period = '1s'
[[services]]
protocol = 'tcp'
internal_port = 25672
auto_stop_machines = "off"
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = 25672
handlers = ['tls']
[[services.tcp_checks]]
interval = '15s'
timeout = '1m0s'
grace_period = '1s'
[[vm]]
memory = '512mb'
cpu_kind = 'shared'
cpus = 1
The docker configuration:
FROM rabbitmq:3.12.14-management
# See: https://www.rabbitmq.com/docs/clustering#community-docker-image-and-kubernetes
ENV RABBITMQ_ERLANG_COOKIE="123456"
COPY ./prod.conf /etc/rabbitmq/rabbitmq.conf
RUN rabbitmq-plugins enable rabbitmq_management
The RabbitMQ configuration:
listeners.tcp.default = 5672
default_user = admin
default_pass = admin
log.console = true
log.console.level = debug
management.tcp.ip = ::
cluster_formation.peer_discovery_backend = dns
cluster_formation.dns.hostname = rabbitmq-dv.internal
When I deploy to one machine, it works well. When I deploy to 3 machines, they cannot connect to each other to form a cluster.
If we want to use RabbitMQ services deployed through fly.io in a production environment, HA (High Availability) is a very important issue.
I would be very grateful if someone could provide some guidance.