Skip to content

Commit

Permalink
[TO BE REVIEWED]v3.5.0-sc core-zone updates (#2250)
Browse files Browse the repository at this point in the history
* v3.5.0-sc core-zone updates

additions

v3.5.0-sc core-zone updates

* updates

* Update 5.zone.md

* Update docs-2.0/5.configurations-and-logs/1.configurations/2.meta-config.md

* fix comment

* comment fix and change routing to reading

* Update 3.graph-config.md

* commit fix

* comment fix

* Update docs-2.0/4.deployment-and-installation/5.zone.md

* Update 5.zone.md

* fix comments
  • Loading branch information
abby-cyber authored Sep 19, 2023
1 parent f816afc commit 81c4758
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 244 deletions.
21 changes: 15 additions & 6 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,21 +21,30 @@ You have [connected to NebulaGraph](3.connect-to-nebula-graph.md).
ADD HOSTS <ip>:<port> [,<ip>:<port> ...];
```

<!--
Example:

```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...] [INTO NEW ZONE "<new_zone_name>"];
nebula> ADD HOSTS 192.168.10.100:9779, 192.168.10.101:9779, 192.168.10.102:9779;
```
-->

Example:
{{ent.ent_begin}}

If enabling the [Zone](../../4.deployment-and-installation/5.zone.md) feature, you still need to specify `INTO ZONE <zone_name>` to add Storage hosts, otherwise the Storage hosts will fail to be added.

```ngql
nebula> ADD HOSTS 192.168.10.100:9779, 192.168.10.101:9779, 192.168.10.102:9779;
ADD HOSTS <ip>:<port> [,<ip>:<port> ...] INTO ZONE <zone_name>;
```

Example:

```ngql
nebula> ADD HOSTS 192.168.8.111:9779,192.168.8.112:9779 INTO ZONE az1;
```
{{ent.ent_end}}

!!! 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).
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.

Expand Down
12 changes: 4 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 DATA 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.**|


* [Job statements](../3.ngql-guide/4.job-statements.md)
Expand All @@ -448,14 +447,11 @@
| `SUBMIT JOB COMPACT` | Triggers the long-term RocksDB `compact` operation. |
| `SUBMIT JOB FLUSH` | Writes the RocksDB memfile in the memory to the hard disk. |
| `SUBMIT JOB STATS` | Starts a job that makes the statistics of the current graph space. Once this job succeeds, you can use the `SHOW STATS` statement to list the statistics. |
| `SUBMIT JOB BALANCE DATA IN ZONE`| Starts a job to balance partition replicas within each Zone. **For enterprise edition only.**|
| `SHOW JOB <job_id>` | Shows the information about a specific job and all its tasks in the current graph space. The Meta Service parses a `SUBMIT JOB` request into multiple tasks and assigns them to the nebula-storaged processes. |
| `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
|`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
62 changes: 59 additions & 3 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 DATA IN ZONE;
+------------+
| New Job Id |
+------------+
| 25 |
+------------+
```

<!-- ```ngql
# Balance partition replicas within a specified Zone.
nebula> SUBMIT JOB BALANCE DATA 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 DATA 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 All @@ -70,14 +126,14 @@ nebula> SUBMIT JOB BALANCE LEADER;
```

<!-- balance-3.1
## SUBMIT JOB BALANCE IN ZONE
## SUBMIT JOB BALANCE DATA IN ZONE
The `SUBMIT JOB BALANCE IN ZONE` statement 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.
The `SUBMIT JOB BALANCE DATA IN ZONE` statement 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.
For example:
```ngql
nebula> SUBMIT JOB BALANCE IN ZONE REMOVE 192.168.10.102:9779;
nebula> SUBMIT JOB BALANCE DATA IN ZONE REMOVE 192.168.10.102:9779;
+------------+
| New Job Id |
+------------+
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.
- 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 | Zones | Comment |
+----+--------------------+------------------+----------------+---------+------------+--------------------+-----------------------+---------+
| 51 | "basketballplayer" | 10 | 4 | "utf8" | "utf8_bin" | "FIXED_STRING(32)" | ["az1", "az2", "az3"] | |
+----+--------------------+------------------+----------------+---------+------------+--------------------+-----------------------+---------+
```
-->
{{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 Zones

!!! 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

0 comments on commit 81c4758

Please sign in to comment.