[zeromq-dev] automatically choosing a free TCP port

Martin Lucina mato at kotelna.sk
Mon Mar 15 16:06:56 CET 2010


Dave,

zxvdr.au at gmail.com said:
> I'll see if I can find some time to investigate this further. It may
> end up that avahi doesn't meet my needs wrt playing nicely in HA (like
> what was mentioned before about restarting on a different port).

HA should work nicely with the proposed scheme (DNS TXT records) and fixed
ports. Fire up instance one of 'service' on server1:5555, instance two of
'service' on server2:5556 and you could have two TXT records for 'service':

service IN TXT "tcp://server1:5555"
service IN TXT "tcp://server2:5556"

0MQ would get back two records from DNS and try in a round-robin fashion
until it can connect to one or the other. Straightforward to debug and not
prone to "magic failures" like I mentioned in my other email.

The only downside is you need access to your DNS zone.

-mato



More information about the zeromq-dev mailing list