Running rabbitmq-peer-discovery-k8s throws socket error

9/5/2018

I have been experimenting with setting up a RabbitMQ cluster with Kubernetes. After doing some research, I stumbled upon the following 2 useful tutorials: https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/ and https://github.com/rabbitmq/rabbitmq-peer-discovery-k8s/tree/master/examples/k8s_statefulsets

The first sets up a simple RabbitMQ Service with a ReplicationController and pushes through a test message, while the second goes a bit further and sets up a StatefulSet with RBAC etc.. So far, so good.

However, when I complete the second tutorial, I am trying to push a test message through, like in the first tutorial by running the slightly adjusted commands:

export BROKER_URL=amqp://guest:guest@rabbitmq:5672
/usr/bin/amqp-declare-queue --url=$BROKER_URL -q foo -d

which then throws the error

logging in to AMQP server: a socket error occurred

At first I thought the URL was wrong, but I verified that it by substituting rabbitmq with the ip address feteched using nslookup rabbitmq (as demonstrated in the first tutorial).

Could anyone help out on what I am missing here?

Thanks

-- user3162649
kubernetes
rabbitmq

1 Answer

10/2/2018

I resolved the problem, it appears the kubernetes guide is outdated: if you use a newer image of unbutu (for example, ubuntu:18.04) when testing, it seems to work!

-- user3162649
Source: StackOverflow