diff --git a/etcdmain/config.go b/etcdmain/config.go index 4bc900bc1ed0..290223791a19 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -24,6 +24,7 @@ import ( "os" "runtime" "strings" + "time" "github.com/coreos/etcd/embed" "github.com/coreos/etcd/pkg/flags" @@ -143,6 +144,9 @@ func newConfig() *config { fs.Int64Var(&cfg.QuotaBackendBytes, "quota-backend-bytes", cfg.QuotaBackendBytes, "Raise alarms when backend size exceeds the given quota. 0 means use the default quota.") fs.UintVar(&cfg.MaxTxnOps, "max-txn-ops", cfg.MaxTxnOps, "Maximum number of operations permitted in a transaction.") fs.UintVar(&cfg.MaxRequestBytes, "max-request-bytes", cfg.MaxRequestBytes, "Maximum client request size in bytes the server will accept.") + fs.DurationVar(&cfg.GRPCKeepAliveEnforcementPolicyMinTime, "grpc-keepalive-min-time", 5*time.Second, "Minimum interval duration that a client should wait before pinging server.") + fs.DurationVar(&cfg.GRPCKeepAliveServerParametersTime, "grpc-keepalive-interval", time.Duration(0), "Frequency duration of server-to-client ping to check if a connection is alive.") + fs.DurationVar(&cfg.GRPCKeepAliveServerParametersTimeout, "grpc-keepalive-timeout", time.Duration(0), "Additional duration of wait before closing a non-responsive connection.") // clustering fs.Var(flags.NewURLsValue(embed.DefaultInitialAdvertisePeerURLs), "initial-advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster.") diff --git a/etcdmain/help.go b/etcdmain/help.go index ad4d30240ee0..9b699e6df64e 100644 --- a/etcdmain/help.go +++ b/etcdmain/help.go @@ -54,6 +54,12 @@ member flags: time (in milliseconds) of a heartbeat interval. --election-timeout '1000' time (in milliseconds) for an election to timeout. See tuning documentation for details. + --grpc-keepalive-interval '5s' + minimum duration interval that a client should wait before pinging server. + --grpc-keepalive-interval '0s' + frequency duration of server-to-client ping to check if a connection is alive. + --grpc-keepalive-timeout '0s' + additional duration of wait before closing a non-responsive connection. --listen-peer-urls 'http://localhost:2380' list of URLs to listen on for peer traffic. --listen-client-urls 'http://localhost:2379'