Search code examples
dockernsq

How to connect nsqd and nsqlookupd containers?


I am trying to connect these 2 docker containers:

nsqd: https://registry.hub.docker.com/u/mreiferson/nsqlookupd/ nsqlookupd: https://registry.hub.docker.com/u/mreiferson/nsqlookupd/

These are the official docker containers for nsqd and nsqlookupd.

The problem is that when I create a topic in nsqd, I do not see that topic in nsqlookupd.

i.e.

curl -d 'hello world 1' 'http://172.17.42.1:4151/put?topic=test'  // to create the test topic

curl http://172.17.42.1:4151/stats  // shows that I have messages with topic = test

curl http://172.17.42.1:4161/topics  // ??? shows that I have no topic.

I start my 2 containers like so (172.17.42.1 is my docker host IP):

docker run --name lookupd -p 4160:4160 -p 4161:4161 mreiferson/nsqlookupd 

docker run  --name nsqd -p 4150:4150 -p 4151:4151 -e BROADCAST_ADDRESS=172.17.42.1:4160 mreiferson/nsqd

I'm obviously connecting the 2 containers incorrectly. How would I go about connecting them properly?


Solution

  • I ended up creating my own nsqd docker container to solve my issue: https://github.com/rexposadas/nsqd