Docker swarm status broadcast possible?

Hi @tananaev apologies for reopening this i'm looking at testing this in a docker swarm across multiple servers, i did some basic research on the multicast broadcast it didn't look like it will work on servers on different subnet.
Any idea will be appreciated on this.

Anton Tananaev2 years ago

Why do they have to be on different subnets? Couldn't you combine them into a single virtual network?

I'm looking at a scenario where my servers are in 3 different data centers, in which a docker cluster is setup between them.

Anton Tananaev2 years ago

I guess it should be possible to implement an alternative sync option. We have this interface:

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/broadcast/BroadcastService.java

So using MulticastBroadcastService.java as an example sendMessage, handleMessage and some others can be modified to synchronize with consul or redis cluster as Hashes data type.
I'm not sure about my assumptions the new Broadcast implementation can then be injected into MainModule

Anton Tananaev2 years ago

Not sure about Redis because you really want messaging solution, not a shared database. I think the simplest option is to implement a individual UDP sync instead of multicast. You also probably need some discovery algorithm, unless server list is predefined.

And my guess is that UDP sync will require the use of a port which will necessitate that a discovery mechanism be implemented, i'm thinking about a simple intermediary like a MQTT broker that each node/instance of the traccar service can subscribe and publish into.
I'm not very knowledgeable in network programming so that might be affecting my judgement of the complexity in implementing this, i'll appreciate any correction/education.

Anton Tananaev2 years ago

Yeah, I think MQTT might work.

Thanks anton, i'll experiment with in my free time.