diff --git a/etcdmain/config.go b/etcdmain/config.go index 54c2e2109..4510a7a1e 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -117,7 +117,8 @@ type config struct { printVersion bool - v3demo bool + v3demo bool + gRPCAddr string ignored []string } @@ -216,6 +217,7 @@ func NewConfig() *config { // demo flag fs.BoolVar(&cfg.v3demo, "experimental-v3demo", false, "Enable experimental v3 demo API") + fs.StringVar(&cfg.gRPCAddr, "experimental-gRPC-addr", "127.0.0.1:2378", "gRPC address for experimental v3 demo API") // backwards-compatibility with v0.4.6 fs.Var(&flags.IPAddressPort{}, "addr", "DEPRECATED: Use -advertise-client-urls instead.") diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 30aa717d8..5c8367967 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -239,11 +239,11 @@ func startEtcd(cfg *config) (<-chan struct{}, error) { var v3l net.Listener if cfg.v3demo { - v3l, err = net.Listen("tcp", "127.0.0.1:12379") + v3l, err = net.Listen("tcp", cfg.gRPCAddr) if err != nil { plog.Fatal(err) } - plog.Infof("listening for client rpc on 127.0.0.1:12379") + plog.Infof("listening for client rpc on %s", cfg.gRPCAddr) } srvcfg := &etcdserver.ServerConfig{