Closed msaf1980 closed 5 years ago
When specifying raft nodes, you can use this-node
parameter to set such binding.
It does not solve. Client socket for raft thread (and may be replication too) not bind to specified address TcpStream::connect not do this, instead of TcpStream::connect_std with custom stream, created and binded with net2::TcpBuilder https://github.com/Albibek/raft-tokio/blob/master/src/tcp.rs#L219
I agree. Going to add this feature soon.
Good news ! I try to add this feature (in raft-tokio and bioyino). Socket was binding to correct address, and work as planned. But leader election don't work without any errors in log (cluster split brain with many master). And at this time I don't undestand why. https://github.com/msaf1980/raft-tokio/commits/master https://github.com/msaf1980/bioyino/tree/statsite-bind
Try enabling trace log in bioyino/raft-tokio. Raft-tokio logs almos every fail there
You can also try running cargo test -- --nocapture
with patched raft-tokio, it will print trace logs by default. This will allow to at least localize problem to either bioyino or rafto-tokio.
Hello. I patched raft-tokio and bioyino for this.
https://github.com/Albibek/raft-tokio/pull/2 https://github.com/avito-tech/bioyino/pull/43
The binding of raft protocol client is in 0.5.0 branch. Snapshot client is the next target. I suppose, carbon client needs the same option as well.
For carbon client - may be in some cases, but it's not necessary for our environment
Add options to bind client sockets for replication and raft to specific IP.