1
0
Fork 0

Merge pull request #117 from rqlite/fix_join

Use Raft advertise address, if exists, during join
master
Philip O'Toole 9 years ago
commit e3c20964fb

@ -1,3 +1,6 @@
## 3.0.1 (May 1st 2016)
- [PR #117](https://github.com/rqlite/rqlite/pull/117): Use Raft advertise address, if exists, during join.
## 3.0.0 (May 1st 2016)
- [PR #116](https://github.com/rqlite/rqlite/pull/116): Allow HTTP advertise address to be set.
- [PR #115](https://github.com/rqlite/rqlite/pull/115): Support advertising address different than Raft bind address.

@ -194,7 +194,7 @@ func main() {
if !store.JoinRequired() {
log.Println("node is already member of cluster, ignoring join request")
} else {
if err := join(joinAddr, noVerify, raftAddr); err != nil {
if err := join(joinAddr, noVerify, raftAddr, raftAdv); err != nil {
log.Fatalf("failed to join node at %s: %s", joinAddr, err.Error())
}
log.Println("successfully joined node at", joinAddr)
@ -252,8 +252,12 @@ func main() {
log.Println("rqlite server stopped")
}
func join(joinAddr string, skipVerify bool, raftAddr string) error {
b, err := json.Marshal(map[string]string{"addr": raftAddr})
func join(joinAddr string, skipVerify bool, raftAddr, raftAdv string) error {
addr := raftAddr
if raftAdv != "" {
addr = raftAdv
}
b, err := json.Marshal(map[string]string{"addr": addr})
if err != nil {
return err
}

Loading…
Cancel
Save