1

I have the following problem:

There is a group of ZMQ-based brokers in the cloud. These would be operated in a Amazon VPC, using a certain IP range.

There are also client apps, these are running on all kinda hosts, and can be located anywhere in the world.

I want these clients to auto discover the available brokers.:

Broker1: 172.44.22.33
Broker2: 172.44.22.34
Broker3: 172.44.22.35
Broker4: 172.44.22.36
....

Client: 82.34.55.12

...when this client starts up, it should fetch the above list of broker IPs.

My question is what's the best way to do this?

Of course the client could use brute force method, trying to connect to all IPs in the range, but this not a nice or efficient solution.

I guess, the VPC could support multicast (via n2n), in which case the client would send a multicast message and the available brokers would "reply" to that using the sender IP, which is always part of the multicast data (as far as I know).

But isn't there a better way to do this? I need the clients to auto discover, because this has to be a zero configuration system.

I know discovery can be done easily on a LAN, either using multicast / broadcast or stuff like bonjure / zeroconf. But the clients are not part of my network, they can be located anywhere.

Thanks in advance!

EDIT:

I know this could be solved in other ways too, like adding "config servers" which would store info about the available brokers, but I would prefer a decentralized solution.

EDIT2:

It seems DNS-SD could be used for this purpose, since wide area discovery is supported. As I can see, I can add some special DNS entries to my DNS server even manually.

The clients only have to know about a domain name whose DNS records stores the data of advertised services.

I guess, the clients need to integrate bonjur / avahi libs or some other DNS-SD implementation to do these queries, right? What's the best free library for this, avahi?

user2297996
  • 1,382
  • 3
  • 18
  • 28

1 Answers1

0

How fast and how many components you will have?

So it is kind of using config server but with a twist, you need a seed list, list of components that you know will always be there.

Each of these component should be a config server or run a discovery service, when a component start it registered with all discovery services in the seed list and also subscribe to changes from all and then internally manage the list of all components from updates from all discovery services.

If you plan to have more than 20 components or so I would suggest using a gossip protocol, but that will be slower until you will recognize all components.

somdoron
  • 4,653
  • 2
  • 16
  • 24
  • Thanks for the answer. There'll be only a couple of brokers in the beginning, but this number will grow fast. In a 6-12 months there could be 100+ brokers serving thousands of clients. Will look into gossip protocol thx. – user2297996 Jan 06 '15 at 15:37