I am trying to run Rabbitmq using Kubernetes on AWS. I use the official Rabbitmq docker container . Each time the pod is reloaded, the rabbitmq container gets a new host name. I installed a service (such as LoadBalancer) for a module with a resolvable DNS name.
But when I use EBS to make the / messsage / rabbit queue configuration persistent between restarts, it breaks down into:
exception exit: {{failed_to_cluster_with, [' rabbitmq@rabbitmq-deployment-2901855891-nord3 '], "Mnesia could not connect to any nodes."}, {rabbit,start,[normal,[]]}} in function application_master:init/4 (application_master.erl, line 134)
rabbitmq-deployment-2901855891-nord3 is the previous rabbitmq hostname container. It almost looks like Mnesia kept the old hostname: - /
The container information is as follows:
Starting broker... =INFO REPORT==== 25-Apr-2016::12:42:42 === node : rabbitmq@rabbitmq-deployment-2770204827-cboj8 home dir : /var/lib/rabbitmq config file(s) : /etc/rabbitmq/rabbitmq.config cookie hash : XXXXXXXXXXXXXXXX log : tty sasl log : tty database dir : /var/lib/rabbitmq/mnesia/rabbitmq
I can only set the first part of the node name in rabbitmq using the environment variable RABBITMQ_NODENAME .
Setting RABBITMQ_NODENAME to a resolvable DNS name is split into:
Can't set short node name!\nPlease check your configuration\n"
Setting RABBITMQ_USE_LONGNAME to true is interrupted:
Can't set long node name!\nPlease check your configuration\n"
Update:
Setting RABBITMQ_NODENAME on rabbitmq @ localhost works, but it negates the possibility of cluster instances.
Starting broker... =INFO REPORT==== 26-Apr-2016::11:53:19 === node : rabbitmq@localhost home dir : /var/lib/rabbitmq config file(s) : /etc/rabbitmq/rabbitmq.config cookie hash : 9WtXr5XgK4KXE/soTc6Lag== log : tty sasl log : tty database dir : /var/lib/rabbitmq/mnesia/ rabbitmq@localhost
Setting the RABBITMQ_NODENAME service name, in this case rabbitmq-service , so rabbitmq @ rabbitmq-service also works because the names of the kubernet services are internally resolvable via DNS.
Starting broker... =INFO REPORT==== 26-Apr-2016::11:53:19 === node : rabbitmq@rabbitmq-service home dir : /var/lib/rabbitmq config file(s) : /etc/rabbitmq/rabbitmq.config cookie hash : 9WtXr5XgK4KXE/soTc6Lag== log : tty sasl log : tty database dir : /var/lib/rabbitmq/mnesia/ rabbitmq@rabbitmq-service
Is it correct? Will I still be able to group multiple instances if the node names match?
amazon-ec2 dns rabbitmq hostname kubernetes
Pieter van der merwe
source share