How to have one RabbitMQ cluster consisting of 2 Kubernetes statefulsets?

9/6/2019

I am using RMQ as broker in my platform and at the moment I am using the Helm chart of RMQ-ha for setting up a RMQ cluster and it is working properly. This helm chart contains 2 services, one (rmq-service) as Loadbalancer for incoming traffic from outside of kubernetes and the other one (rmq-service-discovery) for discovery and I think for internal communications and also 1 statefulset.

I want to have 1 RMQ cluster that consists of two statefulsets, one for incoming traffic and the other for internal communications. I did this by adding another statefulset (broker-public) in the same helm chart and changed the selector part of rmq-service to just select broker-public. Now my platform is up and running and ready but when I send requests I face with this error:

 name: 'RequestError',
  message: 'Error: getaddrinfo EAI_AGAIN deployer deployer:8004',
  cause:
   { Error: getaddrinfo EAI_AGAIN deployer deployer:8004
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'deployer',
     host: 'deployer',
     port: '8004' },

As I searched this error means that "EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error."

Because the configs are huge I just put the related parts for now. rmq-service.yaml:

  selector:
    # app: {{ template "rabbitmq-ha.name" . }}
    # release: {{ .Release.Name }}
    broker: public

broker-public.yaml:

  template:
    metadata:
      labels:
        app: {{ template "rabbitmq-ha.name" . }}
        release: {{ .Release.Name }}
        broker: public
-- AVarf
kubernetes
rabbitmq
service

0 Answers