Skip to content

Commit

Permalink
disable balance data (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-lzy authored Jan 20, 2022
1 parent a392d1d commit 0051f25
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 8 deletions.
11 changes: 8 additions & 3 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,23 +477,28 @@
| 语法 | 说明 |
| :-------------------------------- | :----------------------------------------------------------- |
|`BALANCE LEADER`|在当前图空间内所有 Zone 之间启动任务均衡分布 leader。该命令会返回任务 ID。|
<!-- balance-3.1
|`BALANCE IN ZONE [REMOVE <ip>:<port> [,<ip>:<port> ...]]`|在当前图空间内每个 Zone 内部启动任务均衡分布分片。该命令会返回任务 ID。可以使用`REMOVE`选项指定需要清空的 Storage 节点,方便进行维护。|
|`BALANCE ACROSS ZONE [REMOVE "zone_name" [,"zone_name" ...]]`|在当前图空间内所有 Zone 之间启动任务均衡分布分片,保证各个 Zone 分片数量平衡。该命令会返回任务 ID。可以使用`REMOVE`选项指定需要清空的 Zone,方便进行维护。|
|`BALANCE LEADER`|在当前图空间内所有 Zone 之间启动任务均衡分布 leader。该命令会返回任务 ID。|
-->
* [作业管理](../3.ngql-guide/18.operation-and-maintenance-statements/4.job-statements.md)
| 语法 | 说明 |
| -------------------- | ------------------------------------------------------------ |
|`SUBMIT JOB BALANCE IN ZONE`|在当前图空间内每个 Zone 内部启动任务均衡分布分片。|
|`SUBMIT JOB BALANCE ACROSS ZONE`|在当前图空间内所有 Zone 之间启动任务均衡分布分片。|
| `SUBMIT JOB COMPACT` | 触发 RocksDB 的长耗时`compact`操作。 |
| `SUBMIT JOB FLUSH` | 将内存中的 RocksDB memfile 写入硬盘。 |
| `SUBMIT JOB STATS` | 启动一个作业,该作业对当前图空间进行统计。作业完成后,用户可以使用`SHOW STATS`语句列出统计结果。 |
| `SHOW JOB <job_id>` | 显示当前图空间内指定作业和相关任务的信息。Meta 服务将`SUBMIT JOB`请求解析为多个任务,然后分配给进程 nebula-storaged。 |
| `SHOW JOBS` | 列出当前图空间内所有未过期的作业。 |
| `STOP JOB` | 停止当前图空间内未完成的作业。 |
| `RECOVER JOB` | 重新执行当前图空间内失败的作业,并返回已恢复的作业数量。 |
<!-- balance-3.1
|`SUBMIT JOB BALANCE IN ZONE`|在当前图空间内每个 Zone 内部启动任务均衡分布分片。|
|`SUBMIT JOB BALANCE ACROSS ZONE`|在当前图空间内所有 Zone 之间启动任务均衡分布分片。|
-->
* [终止查询](../3.ngql-guide/18.operation-and-maintenance-statements/6.kill-query.md)
Expand Down
2 changes: 2 additions & 0 deletions docs-2.0/20.appendix/0.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ Nebula Graph {{ nebula.release }} 未提供运维命令以实现自动扩缩容

- storaged 的扩容:(副本数都必须大于 1) 在新机器上准备 storaged 二进制文件和配置文件,在配置文件中修改或增加已在运行的 metad 地址,启动 storaged 进程。

<!-- balance-3.1
storaged 扩缩容之后,还需要运行 [Balance Data 和 Balance Leader 命令](../8.service-tuning/load-balance.md)。
-->

### 修改 Host 名称后,旧的 Host 一直显示 `OFFLINE` 怎么办?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

!!! compatibility "历史版本兼容性"

Neubla Graph 3.0.0 新增 Zone 功能导致 Balance 命令发生变化,3.0.0 之前版本的命令不再兼容
不支持`BALANCE DATA`命令

`BALANCE`语法说明如下。

|语法|说明|
|:---|:---|
|`BALANCE LEADER`|在当前图空间内所有 Zone 之间启动任务均衡分布 leader。该命令会返回任务 ID。|
<!-- balance-3.1
|`BALANCE IN ZONE [REMOVE <ip>:<port> [,<ip>:<port> ...]]`|在当前图空间内每个 Zone 内部启动任务均衡分布分片。该命令会返回任务 ID。可以使用`REMOVE`选项指定需要清空的 Storage 节点,该节点的分片会移动到其他节点,方便进行维护。|
|`BALANCE ACROSS ZONE [REMOVE "zone_name" [,"zone_name" ...]]`|在当前图空间内所有 Zone 之间启动任务均衡分布分片,保证各个 Zone 分片数量平衡。该命令会返回任务 ID。可以使用`REMOVE`选项指定需要清空的 Zone,该节点的分片会移动到其他节点,方便进行维护。|
|`BALANCE LEADER`|在当前图空间内所有 Zone 之间启动任务均衡分布 leader。该命令会返回任务 ID。|
!!! note
`REMOVE`只能清空当前图空间的分片,如果 Storage 节点的图空间较多,需要切换到不同图空间执行`REMOVE`操作。
-->

查看、停止、重启任务,请参见[作业管理](4.job-statements.md)
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

所有作业管理命令都需要先选择图空间后才能执行。

<!-- balance-3.1
## SUBMIT JOB BALANCE IN ZONE
`SUBMIT JOB BALANCE IN ZONE`语句会在当前图空间内每个 Zone 内部启动任务均衡分布分片。该命令会返回任务 ID。可以使用`REMOVE`选项指定需要清空的 Storage 节点,方便进行维护。
Expand Down Expand Up @@ -35,6 +36,7 @@ nebula> SUBMIT JOB BALANCE ACROSS ZONE REMOVE "zone1";
| 27 |
+------------+
```
-->

## SUBMIT JOB COMPACT

Expand Down
6 changes: 6 additions & 0 deletions docs-2.0/4.deployment-and-installation/5.zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ nebula> SHOW ZONES;

将 Storage 节点加入已创建的 Zone。

<!-- balance-3.1
!!! note
加入之后请使用 [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) 命令实现负载均衡。
-->

```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...] INTO ZONE "<zone_name>";
Expand Down Expand Up @@ -118,9 +120,11 @@ DROP ZONE "<zone_name>";

合并时将检查所有图空间分片的分布情况,防止同一个分片的不同副本因为合并导致分布在同一个 Zone 中。

<!-- balance-3.1
!!! note
合并之后请使用 [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) 命令实现负载均衡。
-->

```ngql
MERGE ZONE "<zone_name>" [,"<zone_name>" ...] INTO "<new_zone_name>";
Expand All @@ -136,9 +140,11 @@ MERGE ZONE "default_zone_192.168.10.100_9779","default_zone_192.168.10.101_9779"

将一个 Zone 中的所有 Storage 节点分离至多个新建 Zone。

<!-- balance-3.1
!!! note
分离之后请使用 [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) 命令实现负载均衡。
-->

```ngql
DIVIDE ZONE "<zone_name>" INTO "<new_zone_name>"(<ip>:<port>) ["<new_zone_name>"(<ip>:<port>) ...];
Expand Down
5 changes: 4 additions & 1 deletion docs-2.0/7.data-security/1.authentication/3.role-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Nebula Graph 内置了多种角色,说明如下:
|权限|God |Admin|DBA|User|Guest|相关语句|
|:---|:---|:---|:---|:---|:---|:---|
|Read space|Y|Y|Y|Y|Y|`USE``DESCRIBE SPACE`|
|Write space|Y|||||`CREATE SPACE``DROP SPACE``CREATE SNAPSHOT``DROP SNAPSHOT``BALANCE DATA``BALANCE DATA STOP``BALANCE DATA REMOVE``BALANCE LEADER``ADMIN``CONFIG``INGEST``DOWNLOAD``BUILD TAG INDEX``BUILD EDGE INDEX`|
|Read schema|Y|Y|Y|Y|Y|`DESCRIBE TAG``DESCRIBE EDGE``DESCRIBE TAG INDEX``DESCRIBE EDGE INDEX`|
|Write schema|Y|Y|Y|||`CREATE TAG``ALTER TAG``CREATE EDGE``ALTER EDGE``DROP TAG``DELETE TAG``DROP EDGE``CREATE TAG INDEX``CREATE EDGE INDEX``DROP TAG INDEX``DROP EDGE INDEX`|
|Write user|Y|||||`CREATE USER``DROP USER``ALTER USER`|
Expand All @@ -66,6 +65,10 @@ Nebula Graph 内置了多种角色,说明如下:
|Write data|Y|Y|Y|Y||`INSERT VERTEX``UPDATE VERTEX``INSERT EDGE``UPDATE EDGE``DELETE VERTEX``DELETE EDGES``DELETE TAG`|
|Show operations|Y|Y|Y|Y|Y|`SHOW``CHANGE PASSWORD`|
|Job|Y|Y|Y|Y||`SUBMIT JOB COMPACT``SUBMIT JOB FLUSH``SUBMIT JOB STATS``STOP JOB``RECOVER JOB`|
|Write space|Y|||||`CREATE SPACE``DROP SPACE``CREATE SNAPSHOT``DROP SNAPSHOT``BALANCE``ADMIN``CONFIG``INGEST``DOWNLOAD``BUILD TAG INDEX``BUILD EDGE INDEX`|
<!-- balance-3.1
|Write space|Y|||||`CREATE SPACE`、`DROP SPACE`、`CREATE SNAPSHOT`、`DROP SNAPSHOT`、`BALANCE ZONE`、`BALANCE LEADER`、`ADMIN`、`CONFIG`、`INGEST`、`DOWNLOAD`、`BUILD TAG INDEX`、`BUILD EDGE INDEX`|
-->

!!! caution

Expand Down
6 changes: 6 additions & 0 deletions docs-2.0/8.service-tuning/load-balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

用户可以使用`BALANCE`语句平衡分片和 Raft leader 的分布,或者清空某些 Storage 服务器方便进行维护。详情请参见 [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md)

!!! compatibility "历史版本兼容性"

不支持`BALANCE DATA`命令。

<!-- balance-3.1
!!! danger
`BALANCE`命令通过创建和执行一组子任务来迁移数据和均衡分片分布,不要停止集群中的任何机器或改变机器的 IP 地址,直到所有子任务完成,否则后续子任务会失败。
Expand Down Expand Up @@ -126,6 +131,7 @@
```ngql
nebula> DROP HOSTS 192.168.10.104:9779,192.168.10.105:9779;
```
-->

## 均衡 leader 分布

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@
选择指定图空间,查看指定图空间的 Partition 分布情况。

## 服务信息
展示 Storage 服务的基本信息。用户可以通过右上角的 **Balance Data** 按钮启动任务,均衡分布集群中的所有分片。参数说明如下:

展示 Storage 服务的基本信息。参数说明如下:

<!-- balance-3.1
用户可以通过右上角的 **Balance Data** 按钮启动任务,均衡分布集群中的所有分片。
-->


| 参数 | 说明 |
| :--- | :--- |
Expand Down
2 changes: 2 additions & 0 deletions docs-2.0/nebula-dashboard-ent/4.cluster-operator/4.manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

单击**停止**/**重启**,会立即中断进行中的任务,可能会导致数据不一致,请在业务低峰期执行该操作。

<!-- balance-3.1
## 扩缩容
- 在扩缩容页面,用户可以快速**添加节点**、**批量导入节点**,并对已存在的节点添加 **Graph 服务**及 **Storage 服务**。
Expand All @@ -40,6 +41,7 @@
在下方的**服务**中,绿色表示即将新增的服务,红色表示即将移除的服务。可以修改新增服务的端口号、HTTP 端口号、HTTP2 端口号信息。
![扩缩容](../figs/scaling-ds.png)
-->

## 更新配置

Expand Down
2 changes: 2 additions & 0 deletions docs-2.0/nebula-dashboard-ent/8.faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ Nebula Graph 是分布式图数据库,可以支持运行时动态扩展和缩

Meta 服务主要存储 Nebula Graph 数据库中的元数据。一旦 Meta 服务出现问题,整个集群会面临瘫痪风险。且 Meta 处理的数据量较少,一般不会出现扩缩容场景,因此我们直接在 Dashboard 中禁用了操作 Meta,防止出现用户误操作导致集群不可用的情况。

<!-- balance-3.1
## 扩缩容之后对数据有什么影响?
- 扩容 Storage,Dashboard 会在指定的机器上创建并运行 Storage 服务,对已有数据不会造成影响,可以在集群信息标签页下的 `服务信息` 页面和 `Leader` 页面,根据自身需求选择进行`Balance Data`或者`Balance Leader`操作。
- 缩容 Storage,Dashboard 会自动执行`Balance Data Remove`语句,确保被指定的服务上的数据分片迁移完成后,停止服务。
- 扩缩容 Graph 对数据不会有影响。
-->

## 为什么无法启动 Dashboard(企业版)?

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ nav:
- 配置 Nebula Graph 集群:
- 自定义 Nebula Graph 集群的配置参数: nebula-operator/8.custom-cluster-configurations/8.1.custom-conf-parameter.md
- 回收 PV: nebula-operator/8.custom-cluster-configurations/8.2.pv-reclaim.md
- 均衡扩容后的 Storage 数据: nebula-operator/8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md
#banlance-3.1 notice Exclude - 均衡扩容后的 Storage 数据: nebula-operator/8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md
- 升级 Nebula Graph 集群: nebula-operator/9.upgrade-nebula-cluster.md
- 连接 Nebula Graph 数据库: nebula-operator/4.connect-to-nebula-graph-service.md
- 故障自愈: nebula-operator/5.operator-failover.md
Expand Down Expand Up @@ -545,6 +545,7 @@ plugins:
- nebula-flink/*
- CHANGELOG.md
- spark-connector/*
- nebula-operator/8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md
# Exclude the file with the following file name.
# - abc.md
# Exclude files with regular expressions (regexes)
Expand Down

0 comments on commit 0051f25

Please sign in to comment.