Closed haifeiWu closed 3 years ago
This question has been asked enough, that I'll document something more concrete once https://github.com/mailgun/holster/pull/77 which includes a discovery
package used to monitor peers.
To answer your question you must use an external system like kubernetes or nomad/consul to know when a node comes up or goes down. There is some existing code in https://github.com/mailgun/gubernator/blob/master/daemon.go#L154-L183 that should give you a starting point. You just have to call pool.Set()
when the kubernetes, nomad, memberlist notifies you when the nodes have changed.
I hope this gives you some insight.
got it thank you
When a new server joins or goes offline,how groupcache solve this problem