Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: add operator example for split region #866

Merged
merged 4 commits into from
Oct 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions tools/pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ export PD_ADDR=http://127.0.0.1:2379
```

`max-merge-region-size` 控制 Region Merge 的 size 上限(单位是 M)。
regionSize 大于指定值时 PD 不会将其与相邻的 Region 合并。设置为 0 表示不开启 Region Merge 功能。
Region Size 大于指定值时 PD 不会将其与相邻的 Region 合并。设置为 0 表示不开启 Region Merge 功能。

```bash
>> config set max-merge-region-size 16 // 设置 Region Merge 的 size 上限为 16M
```

`max-merge-region-rows` 控制 Region Merge 的 rowCount 上限。
regionRowCount 大于指定值时 PD 不会将其与相邻的 Region 合并。
Region RowCount 大于指定值时 PD 不会将其与相邻的 Region 合并。

```bash
>> config set max-merge-region-rows 50000 // 设置 Region Merge 的 rowCount 上限为 50k
Expand Down Expand Up @@ -234,7 +234,7 @@ Merge 调度的开销较大,所以这个值不宜调得过大。
当两个 store 的 leader 或 Region 的得分差距小于指定倍数的 Region size 时,PD 会认为此时 balance 达到均衡状态。

```bash
>> config set tolerant-size-ratio 20 // 设置缓冲区为约 20 倍平均 regionSize
>> config set tolerant-size-ratio 20 // 设置缓冲区为约 20 倍平均 RegionSize
```

`low-space-ratio` 用于设置 store 空间不足的阈值。
Expand Down Expand Up @@ -365,7 +365,7 @@ Success!

### operator [show | add | remove]

用于显示和控制调度操作。
用于显示和控制调度操作,或者对 Region 进行分裂或合并

示例:

Expand All @@ -385,6 +385,8 @@ Success!
>> operator remove 1 // 把 Region 1 的调度操作删掉
```

其中,Region 的分裂都是尽可能地从靠近中间的位置开始。对这个位置的选择支持两种策略,即 scan 和 approximate。它们之间的区别是,前者通过扫描这个 Region 的方式来确定中间的 key,而后者是通过查看 SST 文件中记录的统计信息,来得到近似的位置。一般来说,前者更加精确,而后者消耗更少的 I/O,可以更快地完成。

### ping

用于显示`ping` PD 所需要花费的时间
Expand Down Expand Up @@ -479,7 +481,7 @@ Protobuf 格式示例:

### `region topread [limit]`

用于查询读流量最大的 region。limit 的默认值是 16。
用于查询读流量最大的 Region。limit 的默认值是 16。

示例:

Expand All @@ -493,7 +495,7 @@ Protobuf 格式示例:

### `region topwrite [limit]`

用于查询写流量最大的 region。limit 的默认值是 16。
用于查询写流量最大的 Region。limit 的默认值是 16。

示例:

Expand All @@ -507,7 +509,7 @@ Protobuf 格式示例:

### `region topconfver [limit]`

用于查询 conf version 最大的 region。limit 的默认值是 16。
用于查询 conf version 最大的 Region。limit 的默认值是 16。

示例:

Expand All @@ -521,7 +523,7 @@ Protobuf 格式示例:

### `region topversion [limit]`

用于查询 version 最大的 region。limit 的默认值是 16。
用于查询 version 最大的 Region。limit 的默认值是 16。

示例:

Expand All @@ -535,7 +537,7 @@ Protobuf 格式示例:

### `region topsize [limit]`

用于查询 approximate size 最大的 region。limit 的默认值是 16。
用于查询 approximate size 最大的 Region。limit 的默认值是 16。

示例:

Expand All @@ -549,7 +551,7 @@ Protobuf 格式示例:

### region check [miss-peer | extra-peer | down-peer | pending-peer | incorrect-ns]

用于查询处于异常状态的 region,各类型的意义如下
用于查询处于异常状态的 Region,各类型的意义如下

- miss-peer:缺副本的 Region
- extra-peer:多副本的 Region
Expand Down Expand Up @@ -599,7 +601,7 @@ Protobuf 格式示例:
>> store delete 1 // 下线 store id 为 1 的 store
......
>> store label 1 zone cn // 设置 store id 为 1 的 store 的键为 "zone" 的 label 的值为 "cn"
>> store weight 1 5 10 // 设置 store id 为 1 的 store 的 leader weight 为 5,region weight 为 10
>> store weight 1 5 10 // 设置 store id 为 1 的 store 的 leader weight 为 5,Region weight 为 10
```

### table_ns [create | add | remove | set_store | rm_store | set_meta | rm_meta]
Expand Down