Skip to content

Commit

Permalink
feat: disable scaling down by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RayHuangCN committed Feb 22, 2021
1 parent aa67c2d commit 3535228
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ When the shard is emptied, the shard becomes idle, and wiil be deleted after a c
You can set the idle time of Coordinaor using the following parameters and turn off shrinkage by set it to 0.

> ```
> - --shard.max-idle-time=3h // default
> - --shard.max-idle-time=0 // disable scaling down
> - --shard.max-idle-time=3h
> - --shard.max-idle-time=0 // default
> ```
If `StatefulSet` is used to manage shards, you can add a parameter that will allow the Coordinator to automatically remove the `PVC` when the shard is removed
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Coordinator 使用 label 选择器来选择分片的StatefulSets, 每一个State
您可以通过Coordinaor的以下参数来设置闲置时间,当设置为0时关闭缩容。

> ```
> - --shard.max-idle-time=3h // 默认
> - --shard.max-idle-time=0 // 关闭缩容
> - --shard.max-idle-time=3h
> - --shard.max-idle-time=0 // 默认
> ```
如果使用的是Statefulset来管理分片,您可以添加一下参数来让Coordinator在删除分片时自动删除pvc
Expand Down
2 changes: 1 addition & 1 deletion cmd/kvass/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func init() {
coordinatorCmd.Flags().IntVar(&cdCfg.shardPort, "shard.port", 8080, "the port of sidecar server")
coordinatorCmd.Flags().Int64Var(&cdCfg.shardMaxSeries, "shard.max-series", 1000000, "max series of per shard")
coordinatorCmd.Flags().Int32Var(&cdCfg.shardMaxShard, "shard.max-shard", 999999, "max shard number")
coordinatorCmd.Flags().DurationVar(&cdCfg.shardMaxIdleTime, "shard.max-idle-time", time.Hour*3,
coordinatorCmd.Flags().DurationVar(&cdCfg.shardMaxIdleTime, "shard.max-idle-time", 0,
"wait time before shard is removed after shard become idle,"+
"scale down is disabled if this flag is 0")
coordinatorCmd.Flags().BoolVar(&cdCfg.shardDeletePVC, "shard.delete-vpc", true, "kvass will delete pvc when shard is removed")
Expand Down

0 comments on commit 3535228

Please sign in to comment.