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

update balance #1028

Merged
merged 4 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Execution succeeded
## Reserved keywords

```ngql
ACROSS
ADD
ALTER
AND
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SHOW INDEX STATUS

`SHOW INDEX STATUS` returns the name of the created tag or edge type index and its status.
`SHOW INDEX STATUS` returns the name of the created tag or edge type index and its status of job.

The index status includes:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

The `BALANCE` statements support the load balancing operations of the Nebula Graph Storage services. For more information about storage load balancing and examples for using the `BALANCE` statements, see [Storage load balance](../../8.service-tuning/load-balance.md).

!!! compatibility "Legacy version compatibility"

The `BALANCE` commands is changed because the zone feature is added to Nebula Graph version 3.0.0, `BALANCE` commands before version 3.0.0 is not compatible.

The `BALANCE` statements are listed as follows.

|Syntax|Description|
|-|-|
|`BALANCE DATA`|Starts a task to balance the distribution of storage partitions in a Nebula Graph cluster or a Group. It returns the task ID (`balance_id`). |
|`BALANCE DATA <balance_id>`|Shows the status of the `BALANCE DATA` task.|
|`BALANCE DATA STOP`|Stops the `BALANCE DATA` task.|
|`BALANCE DATA REMOVE <host_list>`|Scales in the Nebula Graph cluster and detaches specific storage hosts.|
|`BALANCE LEADER`|Balances the distribution of storage raft leaders in a Nebula Graph cluster or a Group.|
|:---|:---|
|`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 LEADER`| Starts a job to balance the distribution of storage leaders across each zone in the current graph space. It returns the job ID.|

For details about how to view, stop, and restart a job, see [Job manager and the JOB statements](4.job-statements.md)。
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,43 @@ The long-term tasks run by the Storage Service are called jobs, such as `COMPACT

All job management commands can be executed only after selecting a graph space.

## SUBMIT JOB BALANCE 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.

For example:

```ngql
nebula> SUBMIT JOB BALANCE IN ZONE REMOVE 192.168.10.102:9779;
+------------+
| New Job Id |
+------------+
| 26 |
+------------+
```

## SUBMIT JOB BALANCE ACROSS ZONE

The `SUBMIT JOB BALANCE ACROSS ZONE` statement starts a job to balance the distribution of storage partitions across all the zones 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.

For example:

```ngql
nebula> SUBMIT JOB BALANCE ACROSS ZONE REMOVE "zone1";
+------------+
| New Job Id |
+------------+
| 27 |
+------------+
```

## SUBMIT JOB COMPACT

The `SUBMIT JOB COMPACT` statement triggers the long-term RocksDB `compact` operation.
The `SUBMIT JOB COMPACT` statement triggers the long-term RocksDB `compact` operation in the current graph space.

For more information about `compact` configuration, see [Storage Service configuration](../../5.configurations-and-logs/1.configurations/4.storage-config.md).

### Example
For example:

```ngql
nebula> SUBMIT JOB COMPACT;
Expand All @@ -25,9 +55,9 @@ nebula> SUBMIT JOB COMPACT;

## SUBMIT JOB FLUSH

The `SUBMIT JOB FLUSH` statement writes the RocksDB memfile in the memory to the hard disk.
The `SUBMIT JOB FLUSH` statement writes the RocksDB memfile in the memory to the hard disk in the current graph space.

### Example
For example:

```ngql
nebula> SUBMIT JOB FLUSH;
Expand All @@ -46,7 +76,7 @@ The `SUBMIT JOB STATS` statement starts a job that makes the statistics of the c

If the data stored in the graph space changes, in order to get the latest statistics, you have to run `SUBMIT JOB STATS` again.

### Example
For example:

```ngql
nebula> SUBMIT JOB STATS;
Expand All @@ -63,7 +93,7 @@ The Meta Service parses a `SUBMIT JOB` request into multiple tasks and assigns t

`job_id` is returned when you run the `SUBMIT JOB` statement.

### Example
For example:

```ngql
nebula> SHOW JOB 34;
Expand Down Expand Up @@ -114,7 +144,7 @@ The `SHOW JOBS` statement lists all the unexpired jobs in the current graph spac

The default job expiration interval is one week. You can change it by modifying the `job_expired_secs` parameter of the Meta Service. For how to modify `job_expired_secs`, see [Meta Service configuration](../../5.configurations-and-logs/1.configurations/2.meta-config.md).

### Example
For example:

```ngql
nebula> SHOW JOBS;
Expand All @@ -131,9 +161,9 @@ nebula> SHOW JOBS;

## STOP JOB

The `STOP JOB` statement stops jobs that are not finished in the current graph space.
The `STOP JOB <job_id>` statement stops jobs that are not finished in the current graph space.

### Example
For example:

```ngql
nebula> STOP JOB 22;
Expand All @@ -146,9 +176,9 @@ nebula> STOP JOB 22;

## RECOVER JOB

The `RECOVER JOB` statement re-executes the failed jobs in the current graph space and returns the number of recovered jobs.
The `RECOVER JOB [<job_id>]` statement re-executes the jobs that status is `QUEUE`, `FAILED` or `STOPPED` in the current graph space and returns the number of recovered jobs. If `<job_id>` is not specified, re-execution is performed from the earliest job and the number of jobs that have been recovered is returned.

### Example
For example:

```ngql
nebula> RECOVER JOB;
Expand Down
8 changes: 6 additions & 2 deletions docs-2.0/4.deployment-and-installation/5.zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Add the Storage services to an existing zone.

!!! note

Use the [BALANCE DATA](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) command to balance the load after adding the Storage services.
Use the [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) command to balance the load after adding the Storage services.

```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...] INTO ZONE "<zone_name>";
Expand Down Expand Up @@ -118,6 +118,10 @@ Merge Storage services in multiple zones into a new zone.

The distribution of partitions will be checked during the merge to prevent different partition replicas from being distributed in the same zone.

!!! note

Use the [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) command to balance the load after Merging the Storage services.

```ngql
MERGE ZONE "<zone_name>" [,"<zone_name>" ...] INTO "<new_zone_name>";
```
Expand All @@ -134,7 +138,7 @@ Divide Storage services in a zone into multiple new zones.

!!! note

Use the [BALANCE DATA](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) command to balance the load after dividing the Storage services.
Use the [BALANCE](../3.ngql-guide/18.operation-and-maintenance-statements/2.balance-syntax.md) command to balance the load after dividing the Storage services.

```ngql
DIVIDE ZONE "<zone_name>" INTO "<new_zone_name>"(<ip>:<port>) ["<new_zone_name>"(<ip>:<port>) ...];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ For all parameters and their current values, see [Configurations](1.configuratio

| Name | Predefined value | Description |
| ------------------- | ------------------------ | ------------------------------------------ |
| `system_memory_high_watermark_ratio` | - | Specifies the trigger threshold of the high-level memory alarm mechanism. The default value is `0.9`. If the system memory usage is higher than this value, an alarm mechanism will be triggered, and Nebula Graph will stop querying. This parameter is not predefined in the initial configuration files. |
| `system_memory_high_watermark_ratio` | `0.8` | Specifies the trigger threshold of the high-level memory alarm mechanism. If the system memory usage is higher than this value, an alarm mechanism will be triggered, and Nebula Graph will stop querying. This parameter is not predefined in the initial configuration files. |

## Experimental configurations

Expand Down
Loading