mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
main: fix temporary discovery cluster
This commit is contained in:
parent
d98fe2ce1a
commit
5098cb0d32
11
main.go
11
main.go
@ -60,7 +60,10 @@ var (
|
|||||||
func init() {
|
func init() {
|
||||||
flag.Var(cluster, "initial-cluster", "Initial cluster configuration for bootstrapping")
|
flag.Var(cluster, "initial-cluster", "Initial cluster configuration for bootstrapping")
|
||||||
flag.Var(clusterState, "initial-cluster-state", "Initial cluster configuration for bootstrapping")
|
flag.Var(clusterState, "initial-cluster-state", "Initial cluster configuration for bootstrapping")
|
||||||
cluster.Set("default=http://localhost:2380,default=http://localhost:7001")
|
if err := cluster.Set("default=http://localhost:2380,default=http://localhost:7001"); err != nil {
|
||||||
|
// Should never happen
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
flag.Var(flagtypes.NewURLsValue("http://localhost:2380,http://localhost:7001"), "advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster")
|
flag.Var(flagtypes.NewURLsValue("http://localhost:2380,http://localhost:7001"), "advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster")
|
||||||
flag.Var(flagtypes.NewURLsValue("http://localhost:2379,http://localhost:4001"), "advertise-client-urls", "List of this member's client URLs to advertise to the rest of the cluster")
|
flag.Var(flagtypes.NewURLsValue("http://localhost:2379,http://localhost:4001"), "advertise-client-urls", "List of this member's client URLs to advertise to the rest of the cluster")
|
||||||
@ -261,9 +264,11 @@ func setClusterForDiscovery() error {
|
|||||||
}
|
}
|
||||||
addrs := make([]string, len(apurls))
|
addrs := make([]string, len(apurls))
|
||||||
for i := range apurls {
|
for i := range apurls {
|
||||||
addrs[i] = apurls[i].String()
|
addrs[i] = fmt.Sprintf("%s=%s", *name, apurls[i].String())
|
||||||
|
}
|
||||||
|
if err := cluster.Set(strings.Join(addrs, ",")); err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
cluster.Set(fmt.Sprintf("%s=%s", *name, strings.Join(addrs, ",")))
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user