0

I am working on designing a dynamic system that contains some edge devices lets say 100 for the moment out of which one device has to be the master, that has some different task.

So I have searched a google a lot, and got some useful tools and algorithm but they have some cons in accordance to the system I am designing. Like taking example of Zookeeper, the issue is you have to define the hard-coded IP address in zoo.cfg file. I can define that, but what if device got reboot and IP got change? So to overcome this I am planning to implement below:

Blockquote

So I have following doubts:

Is there any ready made tool/software/approach available that can do the same work in a better (fast, less complex, less overhead on system etc.) way?

Overall problem @romkey

Although I think the overall problem doesn't have any link with this so I have not shared before, but as requested I am sharing: system have 10+edge and 100+UC that t/f data over MQTT. I do not want to hard code the MQTT broker IP in each UC(so that if edge gets down, it will connect to different edge). On powered up UC listen to a UDP message which is t/f by master, that message has IP of master, then connect to master MQTT broker and requested for edge IP. Master response back with edge IP over MQTT. Then UC connect to edge MQTT broker and continues work.

So for above this we need a master among all edge. They don't know the IP of each other.

If you have some approach please share.

Edit 1:

What kind of network technology do you have between all those devices? Wired, wireless? Peer-to-peer, mesh? Do they all hear all others (single broadcast domain)? Do you have bandwidth or energy constraints? Is it possible the network becomes split? Is there communication to the outside? Shouldn't the master MQTT broker be outside ("in the cloud")?

  • All UC and edge devices are on same network(wireless & Intranet). Master device allocate the edges to micro-controller on load balancing algorithm.
  • Yes they all listening to over broadcast IP, same port.
  • No energy constraint.
  • By split if you mean two different n/w, then no.
  • No, we required a solution that works without depending on network. We can't expose such a large number of micro-controller to internet. So MQTT broker is running locally on each edge.
Bence Kaulics
  • 7,783
  • 8
  • 41
  • 90
  • Please list the various algorithms and their cons for you. Otherwise, I wouldn't know whether you've already considered something like raft. You'll also have to define "better way". – kalyanswaroop Jul 28 '21 at 21:20
  • When I see questions like this, I always want to know: what is the problem you're trying to solve with this? People are often overly prescriptive... they ask questions about how to make a particular thing work when there are better or simpler solutions to a problem. What's the problem you're trying to solve with this architecture, or what is the application you're trying to build? Unless you're just intellectually curious about how to make something like this work, which is of course totally fair. – romkey Jul 29 '21 at 05:38
  • @kalyanswaroop I have seen around bully and zookeeper, the only issue I am facing in that is required hard coded IP in config file. – Abhishek bhatia Jul 29 '21 at 07:25
  • @romkey, I need a single master among 100s of edge device. That have some other task to do. They all 100 doesn't know the IP of each other. – Abhishek bhatia Jul 29 '21 at 07:28
  • @romkey, updated with overall system process too. Thanks – Abhishek bhatia Jul 29 '21 at 07:50
  • What kind of network technology do you have between all those devices? Wired, wireless? Peer-to-peer, mesh? Do they all hear all others (single broadcast domain)? Do you have bandwidth or energy constraints? Is it possible the network becomes split? Is there communication to the outside? Shouldn't the master MQTT broker be outside ("in the cloud")? – jcaron Jul 29 '21 at 14:18
  • @jcaron, thanks for your response. I have edited my question with answer to your queries. Please let me know if you required any other info. – Abhishek bhatia Jul 29 '21 at 15:53
  • Have you already considered raft that I mentioned above ? It has a leader selection algorithm. I'm not sure whether it needs fixed IP addresses. – kalyanswaroop Jul 29 '21 at 19:22
  • Does it actually matter if not all devices connect to the same broker? Can’t you have inter-broker communication? Have you considered hot-standby solution like VRRP/CARP/HSRP or whatever is trendy at the moment? Otherwise just have each broker broadcast its presence, and have clients use the one with the lowest IP (or any other tie-breaking criterion) amons those seen is the last 3 broadcast intervals for instance. Does it matter if the master changes even if the current one is still operational? – jcaron Jul 30 '21 at 12:50
  • Your assumption "but what if device got reboot and IP got change?" is wrong! A DHCP server will offer the same IP to the same MAC if that IP is still available (it hasnt been reused due to a limited DHCP scoope/ip adr range size). Or you can lock a specific IP adr to a specific MAC adr. See https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol Manual allocation. And why this focus on IP as Zookeeper seems to support DNS? – MatsK Aug 13 '21 at 11:11

0 Answers0