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

[TO BE REVIEWED]v3.5.0-sc core-zone updates #2250

Merged
merged 14 commits into from
Sep 19, 2023
16 changes: 0 additions & 16 deletions docs-2.0/2.quick-start/3.1add-storage-hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,6 @@ You have [connected to NebulaGraph](3.connect-to-nebula-graph.md).
ADD HOSTS <ip>:<port> [,<ip>:<port> ...];
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
```

<!--
```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...] [INTO NEW ZONE "<new_zone_name>"];
```
-->

Example:

```ngql
nebula> ADD HOSTS 192.168.10.100:9779, 192.168.10.101:9779, 192.168.10.102:9779;
```

!!! caution

Make sure that the IP you added is the same as the IP configured for `local_ip` in the `nebula-storaged.conf` file. Otherwise, the Storage service will fail to start. For information about configurations, see [Configurations](../5.configurations-and-logs/1.configurations/1.configurations.md).

2. Check the status of the hosts to make sure that they are all online.

```ngql
Expand Down
11 changes: 3 additions & 8 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,9 @@
|Syntax|Description|
|-|-|
|`BALANCE LEADER`| Starts a job to balance the distribution of all the storage leaders in graph spaces. It returns the job ID.|
<!-- balance-3.1
|`BALANCE IN ZONE [REMOVE <ip>:<port> [,<ip>:<port> ...]]`| Starts a job to balance the distribution of storage partitions in each zone in the current graph space. It returns the job ID. You can use the `REMOVE` option to specify the Storage services that you want to clear for easy maintenance.|
|`BALANCE ACROSS ZONE [REMOVE "zone_name" [,"zone_name" ...]]`| Starts a job to balance the distribution of storage partitions across each zone in the current graph space. It returns the job ID. You can use the `REMOVE` option to specify the zones that you want to clear for easy maintenance.|
-->
|`BALANCE DATA`| Starts a job to balance the distribution of all the storage partitions in graph spaces. It returns the job ID. **For enterprise edition only.**|
|`BALANCE DATA REMOVE <ip:port> [,<ip>:<port> ...]`| Starts a job to migrate the specified storage partitions. The default port is `9779`. **For enterprise edition only.**|
|`BALANCE IN ZONE [REMOVE <ip>:<port> [,<ip>:<port> ...]]`| Starts a job to balance the distribution of storage partitions in each zone in the current graph space. It returns the job ID. You can use the `REMOVE` option to specify the partitions of storage services that you want to migrate to other storage services. **For enterprise edition only.**|
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved


* [Job statements](../3.ngql-guide/4.job-statements.md)
Expand All @@ -452,10 +451,6 @@
| `SHOW JOBS` | Lists all the unexpired jobs in the current graph space. |
| `STOP JOB` | Stops jobs that are not finished in the current graph space. |
| `RECOVER JOB` | Re-executes the failed jobs in the current graph space and returns the number of recovered jobs. |
<!-- balance-3.1
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
|`SUBMIT JOB BALANCE IN ZONE`|Starts a job to balance the distribution of storage partitions in each zone in the current graph space.|
|`SUBMIT JOB BALANCE ACROSS ZONE`|Starts a job to balance the distribution of storage partitions across each zone in the current graph space.|
-->

* [Kill queries](../3.ngql-guide/17.query-tuning-statements/6.kill-query.md)

Expand Down
7 changes: 4 additions & 3 deletions docs-2.0/20.appendix/learning-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ After completing the NebulaGraph learning path, taking [NebulaGraph Certificatio
| Document |
| ------------------------------------------------------------ |
|[Backup&Restore](../backup-and-restore/nebula-br/1.what-is-br.md)|
<!--

{{ent.ent_begin}}
- Resource isolation

| Document |
| ------------------------------------------------------------ |
|[Group & Zone](../7.data-security/5.zone.md)|
-->
|[Zone](../4.deployment-and-installation/5.zone.md)|
{{ent.ent_end}}

- SSL encryption

Expand Down
56 changes: 56 additions & 0 deletions docs-2.0/3.ngql-guide/4.job-statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,62 @@ nebula> SUBMIT JOB BALANCE DATA REMOVE 192.168.8.100:9779;
+------------+
```

## SUBMIT JOB BALANCE DATA IN ZONE

!!! enterpriseonly

Only available for the NebulaGraph Enterprise Edition.

`SUBMIT JOB BALANCE DATA IN ZONE` statement starts a job to balance partition replicas within each Zone. It returns the job ID.

<!-- To balance partition replicas within a specified Zone, you need to add the `<zone_name>` option. -->

For details on zones, see [Manage Zones](../4.deployment-and-installation/5.zone.md).

For example:

```ngql
# Balance partition replicas within each Zone in the current space.
nebula> SUBMIT JOB BALANCE IN ZONE;
+------------+
| New Job Id |
+------------+
| 25 |
+------------+
```

<!-- ```ngql
# Balance partition replicas within a specified Zone.
nebula> SUBMIT JOB BALANCE IN ZONE az1;
+------------+
| New Job Id |
+------------+
| 26 |
+------------+
``` -->

## SUBMIT JOB BALANCE DATA IN ZONE REMOVE

!!! enterpriseonly

Only available for the NebulaGraph Enterprise Edition.

`SUBMIT JOB BALANCE DATA IN ZONE REMOVE` statement starts a job to clear the partitions on specified Storage nodes in Zones in the current graph space. It returns the job ID. Before clearing the Storage nodes, make sure that the remaining Storage nodes in Zones can meet the set number of replicas. For example, if the number of replicas is set to 3, make sure that the remaining Storage nodes are greater than or equal to 3 before executing this command.

For details on Zones, see [Manage Zones](../4.deployment-and-installation/5.zone.md).

For example:

```ngql
# Clear the partitions on the specified Storage nodes.
nebula> SUBMIT JOB BALANCE IN ZONE REMOVE 192.168.10.101:9779,192.168.10.102:9779;
+------------+
| New Job Id |
+------------+
| 26 |
+------------+
```

{{ ent.ent_end }}

## SUBMIT JOB BALANCE LEADER
Expand Down
16 changes: 12 additions & 4 deletions docs-2.0/3.ngql-guide/9.space-statements/1.create-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CREATE SPACE [IF NOT EXISTS] <graph_space_name> (
[replica_factor = <replica_number>,]
vid_type = {FIXED_STRING(<N>) | INT[64]}
)
[COMMENT = '<comment>'];
[COMMENT = '<comment>']
```

|Parameter|Description|
Expand All @@ -28,9 +28,6 @@ CREATE SPACE [IF NOT EXISTS] <graph_space_name> (
|`vid_type`|A required parameter. Specifies the VID type in a graph space. Available values are `FIXED_STRING(N)` and `INT64`. `INT` equals to `INT64`. <br>``FIXED_STRING(<N>)` specifies the VID as a string, while `INT64` specifies it as an integer. `N` represents the maximum length of the VIDs. If you set a VID that is longer than `N` bytes, NebulaGraph throws an error. Note, for UTF-8 chars, the length may vary in different cases, i.e. a UTF-8 Chinese char is 3 byte, this means 11 Chinese chars(length-33) will exeed a FIXED_STRING(32) vid defination.|
|`COMMENT`|The remarks of the graph space. The maximum length is 256 bytes. By default, there is no comments on a space.|

<!--
|`zone_list`|Specifies the zone list to which space belongs. NebulaGraph will create partitions and replicas in these zones. The number of replicas can not exceed the number of zones. If `zone_list` is not specified, it belongs to all zones by default. For more information, see [Manage zone](../../4.deployment-and-installation/5.zone.md).|
-->

!!! caution

Expand Down Expand Up @@ -58,6 +55,17 @@ CREATE SPACE [IF NOT EXISTS] <graph_space_name> (

`graph_space_name`, `partition_num`, `replica_factor`, `vid_type`, and `comment` cannot be modified once set. To modify them, drop the current working graph space with [`DROP SPACE`](./5.drop-space.md) and create a new one with `CREATE SPACE`.

{{ent.ent_begin}}

When creating a graph space, the system will automatically recognize the value of `--zone_list` in the Meta configuration file, which determines whether the Zone feature is enabled:

- If the value is empty, it means the Zone feature is not enabled. In this case, the graph space will be created without specifying Zones.
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
- If the value is not empty, and the number of Zones in `--zone_list` is equal to the number of replicas specified by `replica_factor`, the replicas of each partition in the graph space will be evenly distributed across the Zones specified in `--zone_list`. If the specified number of replicas is not equal to the number of Zones, the creation of the graph space will fail.

For more details on Zones, see [Manage Zones](../../4.deployment-and-installation/5.zone.md).

{{ent.ent_end}}

### Clone graph spaces

```ngql
Expand Down
18 changes: 11 additions & 7 deletions docs-2.0/3.ngql-guide/9.space-statements/4.describe-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ nebula> DESCRIBE SPACE basketballplayer;
+----+--------------------+------------------+----------------+---------+------------+--------------------+---------+
```

<!--
{{ent.ent_begin}}

If you specify Zones for a space, the `DESCRIBE SPACE` statement will show the Zone information of the space. For more information, see [Manage Zones](../../4.deployment-and-installation/5.zone.md).


```ngql
nebula> DESCRIBE SPACE basketballplayer;
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-------------------------------+---------+
| ID | Name | Partition Number | Replica Factor | Charset | Collate | Vid Type | Atomic Edge | Zones | Comment |
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-------------------------------+---------+
| 1 | "basketballplayer" | 10 | 1 | "utf8" | "utf8_bin" | "FIXED_STRING(32)" | false | "default_zone_127.0.0.1_9779" | |
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-------------------------------+---------+
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-----------+---------+
| ID | Name | Partition Number | Replica Factor | Charset | Collate | Vid Type | Atomic Edge | Zones | Comment |
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-----------+---------+
| 1 | "basketballplayer" | 10 | 1 | "utf8" | "utf8_bin" | "FIXED_STRING(32)" | false | "default" | |
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
+----+--------------------+------------------+----------------+---------+------------+--------------------+-------------+-----------+---------+
```
-->
{{ent.ent_end}}

Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ Users can refer to the content of the following configurations, which only show
--port=9779
```

{{ent.ent_begin}}
### (Optional) Configure Zone

!!! enterpriseonly

This section is only applicable to NebulaGraph Enterprise.

A Zone is a logical rack for Storage nodes. You can set up Zones and add specified Storage nodes into these Zones. By configuring the Graph service to directionally access a given Zone, resource isolation and directed data access can be achieved, thereby reducing traffic consumption and cutting costs.

For details, see [Manage Zones](../../4.deployment-and-installation/5.zone.md).
{{ent.ent_end}}

### Start the cluster

Start the corresponding service on **each machine**. Descriptions are as follows.
Expand Down
Loading