Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the broadcast-address of the nsqd , when deployed multiple nsqd on the docker swarm #1173

Closed
guanwenbogit opened this issue Aug 10, 2019 · 3 comments
Labels

Comments

@guanwenbogit
Copy link

I met some trouble when I deploy the nsq cluster on the docker swarm
Well, there are 3 instances in the swarm.
192.168.99.100
192.168.99.101
192.168.99.102

Then I docker stack deploy with the compose file like this:

version: '3'
services:
  nsqlookupd:
    image: nsqio/nsq
    command: /nsqlookupd
    ports:
      - "4160:4160"
      - "4161:4161"
  nsqd:
    image: nsqio/nsq
    deploy:
      mode: global
    command: /nsqd --lookupd-tcp-address=nsqlookupd:4160 
    depends_on:
      - nsqlookupd
    ports:
      - "4150:4150"
      - "4151:4151"
  nsqadmin:
    image: nsqio/nsq
    command: /nsqadmin --lookupd-http-address=nsqlookupd:4161
    depends_on:
      - nsqlookupd
    ports:
      - "4171:4171"

If I didn't set the broadcast-address for the nsqd, it would be set default with host name.
The response from the nsqlookupd/lookup interface like this:

{"channels":["tony"],"producers":[{"remote_address":"10.0.0.10:52210","hostname":"5adf2bdbbe78","broadcast_address":"5adf2bdbbe78","tcp_port":4150,"http_port":4151,"version":"1.1.0"}]}

However, the consumer which is outside of the swarm , can not connect the using the function ConnectToNSQLookupd("192.168.99.100:4161"). Because, the broadcast-address is
5adf2bdbbe78. The consumer can't the parse the hostname to an IP-Address.
Badly, I can not set broadcast-address to the nsqds in the compose-file respectively, like 192.168.99.100,192.168.99.101,192.168.99.102 which are can connected by outside consumer.

Do you have some suggestion for this situation?
Otherwise, may I have to put the consumers into the swarm with the same network or do the docker run manually one by one with broadcast-address setting on my instances?

@ploxiln
Copy link
Member

ploxiln commented Aug 11, 2019

This question is more appropriate for nsqio/nsq than nsqio/go-nsq.

(I don't have a good answer for you, sorry.)

@ploxiln ploxiln transferred this issue from nsqio/go-nsq Aug 11, 2019
@ploxiln
Copy link
Member

ploxiln commented Aug 11, 2019

see also #1078 #980

@ploxiln ploxiln closed this as completed Sep 9, 2019
@mreiferson
Copy link
Member

ping #1073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants