I'm trying to run RabbitMQ in ECS on an AWSVPC network with EFS persistence.
The problem is that ECS on AWSVPC resets the hostname every time the container is restarted. This results in rabbitmq starting an entirely new directory in /var/lib/rabbitmq
so it loses all of it's persistence.
Eg: starting it once, /var/lib/rabbitmq
will contain:
drwxr-xr-x 4 100 root 6.0K Dec 23 13:00 rabbit@ip-10-0-12-171
-rw-r--r-- 1 100 root 90 Dec 23 12:57 rabbit@ip-10-0-12-171-feature_flags
drwxr-xr-x 10 100 root 6.0K Dec 23 12:57 rabbit@ip-10-0-12-171-plugins-expand
The next time it starts the IP will change and everything else will just be dropped.
I've tried setting the HOSTNAME
environment variable but that has no effect whatsoever.
I've tried setting RABBITMQ_MNESIA_DIR
but after the second start the container just cycles and shows no obvious error message for me to post here.
I've tried setting [email protected]
(a route53 managed domain name) on the container. But that results in a puzzling error:
[error] Supervisor net_sup had child net_kernel started with net_kernel:start_link(['[email protected]',shortnames], false, net_sup_dynamic) at undefined exit with reason {'EXIT',nodistribution} in context start_error
The example on the dockerhub page just show setting the hostname. But because this is ECS on an AWSVPC I can't just set hostname
in the container definition. As per the manual:
Note
The hostname parameter is not supported if you are using the awsvpc network mode.
I only need to convince rabbitmq the hostname is static. I don't care what the domain or hostname is externally, just what the the process inside the container thinks is the hostname. Is there any other way to set this other than the hostname
in the task definition?
0 Answers