问题
Background: I've been looking into microservices more specifically service discovery, one thing thats interested me is the SWIM protocol. But I'm a little confused when it comes to new nodes joining the network.
How does a new node joining the cluster get an address of 1 or more nodes of the existing cluster, without their being a single point of faliure?
If you need any further information or have any questions just let me know.
回答1:
please check out scalecube that implements microservices based on swim protocol with gossip protocol improvement
https://github.com/scalecube/scalecube
you can find references: https://github.com/scalecube/scalecube/wiki/Distributed-Computing-Research
in general when new node joining to the network it joins one of the already running cluster nodes (seeds or members) and the cluster gossip about the new member and creating a "cluster" the gossip protocol "infects" the cluster with the membership information.
usually there is a set of nodes that serve as the entry point to the cluster called seeds and they can be a well known members or discovered using diffident methods such as dns name so when new member join the cluster it can look for a host name "seed" and that is resolved to its current or one of the seed ips.
in microservices architecture seeds can also be the api-gateways or specific nodes that act as seeds usually its best to choose the seeds as the members that least subject to changes and upgrades.
I have written a post discussing the topic https://www.linkedin.com/pulse/swim-cluster-membership-protocol-ronen-nachmias/
来源:https://stackoverflow.com/questions/42741917/swim-protocol-how-does-a-new-node-get-an-address-of-an-existing-node-in-a-cluste