agent: use peer IP

This commit is contained in:
Gyu-Ho Lee 2016-12-15 15:56:05 -08:00
parent 73c1f188b4
commit 35db1e9036
No known key found for this signature in database
GPG Key ID: 1DDD39C7EB70C24C
1 changed files with 3 additions and 4 deletions

View File

@ -297,14 +297,13 @@ func (t *transporterServer) Transfer(ctx context.Context, r *Request) (*Response
if t.req.Database == Request_zetcd {
flags2 = []string{
// "-zkaddr", "0.0.0.0:2181",
"-zkaddr", "localhost:2181",
// "-endpoint", clientURLs[t.req.ServerIndex],
"-endpoint", "localhost:2379", // etcd endpoint
"-zkaddr", fmt.Sprintf("%s:2181", peerIPs[t.req.ServerIndex]),
"-endpoint", clientURLs[t.req.ServerIndex],
}
} else {
flags2 = []string{
// "-consuladdr", "0.0.0.0:8500",
"-consuladdr", fmt.Sprintf("%s:8500", t.req.ServerIndex),
"-consuladdr", fmt.Sprintf("%s:8500", peerIPs[t.req.ServerIndex]),
"-etcd", clientURLs[t.req.ServerIndex], // etcd endpoint
}
}