etcdserver: add --max-request-bytes flag

This commit is contained in:
fanmin shi
2017-05-22 16:54:50 -07:00
parent b003734be6
commit 9e7740011b
9 changed files with 59 additions and 11 deletions

View File

@ -83,6 +83,8 @@ const (
// maxPendingRevokes is the maximum number of outstanding expired lease revocations.
maxPendingRevokes = 16
recommendedMaxRequestBytes = 10 * 1024 * 1024
)
var (
@ -259,6 +261,10 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
cl *membership.RaftCluster
)
if cfg.MaxRequestBytes > recommendedMaxRequestBytes {
plog.Warningf("MaxRequestBytes %v exceeds maximum recommended size %v", cfg.MaxRequestBytes, recommendedMaxRequestBytes)
}
if terr := fileutil.TouchDirAll(cfg.DataDir); terr != nil {
return nil, fmt.Errorf("cannot access data directory: %v", terr)
}