Comments (6)
Yep I'll pull this through Serf and Consul - /cc @dadgar for Nomad.
from memberlist.
@sean- any thoughts on this one?
from memberlist.
This is the express reason why hashicorp/go-sockaddr
sorts its addresses before making an address selection. Jiggling the sort order of utils.go
's privateBlocks
is suboptimal, but pragmatic in a pinch (
Lines 25 to 34 in 9800c50
From a correctness perspective, there are a few possible solutions, some more correct than others, but all solutions involve the use of hashicorp/go-sockaddr
(mostly because that's the bestest hammer available, imnsho! 😁 ).
- Sort the addresses returned from the host by their mask length. Something like: https://github.com/hashicorp/go-sockaddr/blob/c403ce7245ed06f545550eb6b80e0f2b1bd7566f/ipaddrs_test.go#L163
- Expose a template that can be evaluated and use a sane default that filters out
127.0.0.1
or uses one of the template helper functions: https://github.com/hashicorp/go-sockaddr/blob/a99c57b5a5f48c51607e63089075fe7434fe219a/template/template.go#L29-L53 - Use
sockaddr.GetPrivateIP()
and remove most of the code inutils.go
: https://github.com/hashicorp/go-sockaddr/blob/a99c57b5a5f48c51607e63089075fe7434fe219a/ifaddr.go#L11-L31 . @slackpad, now that we've just cut a release of both Serf and Consul, I think now would be a good time to do this so any breakage can marinate inmaster
for a while.
@woodsaj , can you run the following few commands and see if they're correct for your environment:
$ go get -u github.com/hashicorp/go-sockaddr/cmd/sockaddr
$ sockaddr eval GetPrivateIP
from memberlist.
$ sockaddr eval GetPrivateIP
192.168.0.102
looks to work correctly. :)
from memberlist.
Ha!, excellent. Thank you for that point of validation.
@slackpad, your call now. :) I'm game for PRing this at some point unless you beat me to it. As far as impact, Consul already has a vendor dependency on go-sockaddr
so that's a no op there. As far as other public projects, Serf and Nomad will need love because there will be a new library dependency. It's not that high on my list to tackle atm, but I can squeeze it in if needed.... or I'll do it on the train this morning (#108).
from memberlist.
Should be fixed at this level by #108.
from memberlist.
Related Issues (20)
- Memberlist.Members safe use docstring HOT 2
- StateLeft members are never reaped HOT 3
- Node pointer passed to NodeJoin channel event delegate has no meta HOT 1
- Failed ping error running inside container
- Too many pending push/pull requests
- DATA RACE in invokeAckHandler
- How to detect and react to TCP only failures
- release new version HOT 2
- Feature request: Update state of node in memberlist
- MacOS arm64 support
- Data race in memberlist.go
- Is there a way to retrieve the member list without joining?
- "No private IP address found" error throwed on MacOS
- Is there any interface can I know when the cluster states got converged. HOT 1
- Question/Help: Anything need to be taken into consideration when implement a customize Transport with grpc
- Is it feasible to reuse the gassip port for grpc service? HOT 1
- `Join` with context cancelation
- Checking the state of the Node in NotifyLeave
- Can nodes be identify each MEMBERLIST without using UDP connections?
- memberlist fails in large-scale clusters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memberlist.