-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind on specific address #195
Conversation
Should be able to do this. Added to 0.5.0 milestone |
I made a dirty patch replacing most occurences of ":%s" by "127.0.0.1:%s", I can try to make a proper patch from that but I am not sure what make the most sense:
does anyone have a use case for per service bind_address ? For my own use case the server has a private interface and a public one and I want to bind everything on the private interface so a global settings is enough for now. |
I think the global setting is fine until we have a use case for a per server bind address. @schmurfy do you want to make this change ? |
yeah I will give it a shot tomorrow, I think I understand the codebase enough now to do it :) |
cool, let us know if you need help. |
I think it should work but for some reason I cannot compile even on master, I have this error:
|
delete |
You also did the change for the raft server only. Was that intentional ? |
it works way better after removing goraft, any idea what happened ? I fixed an issue with config parsing and now everything seems to work, what did you mean by raft server only ? |
You had an old version of goraft checked out. You initially mentioned that you want all servers to bind to a certain address. Currently there're 4 servers:
I think all 4 should bind to the same address. What do you think ? |
That was the idea yeah but with my current changes they already seem to all bind on localhost: $ lsof -nPi | grep daemon
daemon 58178 Schmurfy 16u IPv4 0xdb12a52bb682dc47 0t0 TCP 127.0.0.1:8090 (LISTEN)
daemon 58178 Schmurfy 17u IPv4 0xdb12a52bb667545f 0t0 TCP 127.0.0.1:8099 (LISTEN)
daemon 58178 Schmurfy 20u IPv4 0xdb12a52bb6676c47 0t0 TCP 127.0.0.1:8086 (LISTEN)
daemon 58178 Schmurfy 21u IPv4 0xdb12a52bb667f45f 0t0 TCP 127.0.0.1:8083 (LISTEN) In my initial testing (my dirty patch) changing the address string returned by the config parser was enough and that's what I did in this patch, I had to update the raft_server file because it does things differently: instead of using directly the return value from the config file it is reformatted before use. |
Got it. That looks good to me. I'll merge it in a second. Thanks @schmurfy |
fix(server.go) fix potential deadlock when removing nodes
How can I bind all the servers on a specific address ?
I tried to play around with the config and looked at the sources but I am not familiar enough with go to find the solution (and the config file led me nowhere either).