Skip to content

Commit

Permalink
Optimize quick start guide (#1232)
Browse files Browse the repository at this point in the history
* Migrate figures to OSS

* Delete 1.what-is-br.md

* Update explorer-console.md

* Delete explorer-console.md

* Create explorer-console.md

* Update explorer-console.md

* optimize quick start
  • Loading branch information
randomJoe211 authored Apr 8, 2022
1 parent 832a4a9 commit 0ee0e42
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 50 deletions.
6 changes: 5 additions & 1 deletion docs-2.0/2.quick-start/1.quick-start-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Users can quickly deploy and use Nebula Graph in the following steps.

Then users can use clients to connect to Nebula Graph. Nebula Graph supports a variety of clients. This topic will describe how to use Nebula Console to connect to Nebula Graph.

4. [CRUD in Nebula Graph](4.nebula-graph-crud.md)
4. [Register the Storage Service](3.1add-storage-hosts.md)

When connecting to Nebula Graph for the first time, users must register the Storage Service before querying data.

5. [CRUD in Nebula Graph](4.nebula-graph-crud.md)

Users can use nGQL (Nebula Graph Query Language) to run CRUD after connecting to Nebula Graph.
49 changes: 49 additions & 0 deletions docs-2.0/2.quick-start/3.1add-storage-hosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Register the Storage Service

When connecting to Nebula Graph for the first time, you have to add the Storage hosts, and confirm that all the hosts are online.

!!! compatibility

- Starting from Nebula Graph 3.0.0, you have to run `ADD HOSTS` before reading or writing data into the Storage Service.
- In earlier versions, `ADD HOSTS` is neither needed nor supported.

## Prerequisites

You have [connnected to Nebula Graph](3.connect-to-nebula-graph.md).

## Steps

1. Add the Storage hosts.

Run the following command to add hosts:

```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...];
```

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

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

```ngql
nebula> SHOW HOSTS;
+------------------+------+-----------+----------+--------------+---------------------- +------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+-----------+----------+--------------+---------------------- +------------------------+---------+
| "192.168.10.100" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.101" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.102" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+------------------+------+-----------+----------+--------------+---------------------- +------------------------+---------+
```

The `Status` column of the result above shows that all Storage hosts are online.
45 changes: 0 additions & 45 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,6 @@ In this topic, we will use the following dataset to demonstrate basic CRUD opera

![The demo dataset](https://docs-cdn.nebula-graph.com.cn/figures/dataset-for-crud.png)

## Manage the Storage services in a Nebula Graph cluster

First, add the Storage services to a Nebula Graph cluster.

<!--
For more information, see [Manage zone](../4.deployment-and-installation/5.zone.md)。
-->

!!! compatibility

From Nebula Graph version 3.0.0, the Storage services added in the configuration files **CANNOT** be read or written directly. The configuration files only register the Storage services into the Meta services. You must run the `ADD HOSTS` command to read and write data on Storage servers.

```ngql
ADD HOSTS <ip>:<port> [,<ip>:<port> ...];
```

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

## Check the machine status in the Nebula Graph cluster

We recommend that you check the machine status to make sure that all the Storage services are connected to the Meta services. Run `SHOW HOSTS` as follows.

```ngql
nebula> SHOW HOSTS;
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| "192.168.10.100" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.101" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.102" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```

From the **Status** column of the table in the returned results, you can see that all the Storage services are online.

### Async implementation of `CREATE` and `ALTER`

!!! caution
Expand Down
4 changes: 2 additions & 2 deletions docs-2.0/backup-and-restore/nebula-br/1.what-is-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To back up data, the BR sends a backup request to the leader metad process to tr
This figure shows how the backup is implemented.
![The figure shows the backup procedure](../../figs/ng-ug-001.png "Implementation of backup")
![The figure shows the backup procedure](https://docs-cdn.nebula-graph.com.cn/figures/ng-ug-001.png "Implementation of backup")
When backup files are generated, the file names are generated automatically. A folder name is in the format of `BACKUP_YY_MM_DD_HH_mm_SS`, of which,
Expand Down Expand Up @@ -137,7 +137,7 @@ The restoration process is implemented as follows:
This figure shows how the restoration process is implemented.
![The figure shows the restoration process](../../figs/ng-ug-002.png "Implementation of restoration")
![The figure shows the restoration process](https://docs-cdn.nebula-graph.com.cn/figures/ng-ug-002.png "Implementation of restoration")
-->


Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/nebula-explorer/explorer-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Explorer console allows you to enter nGQL statements and visualize the query res

At the upper right corner of the page, click ![console](figs/nav-console.png) to enter the console page.

The Explorer's console feature is the same as Studio's. For more information, see [Console](../nebula-studio/quick-start/st-ug-console.md).
The Explorer's console feature is the same as Studio's. For more information, see [Console](../nebula-studio/quick-start/st-ug-console.md).
4 changes: 4 additions & 0 deletions docs-2.0/reuse/source_connect-to-nebula-graph.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
This topic provides basic instruction on how to use the native CLI client Nebula Console to connect to Nebula Graph.

!!! caution

When connecting to Nebula Graph for the first time, you must [register the Storage Service](../2.quick-start/3.1add-storage-hosts.md) before querying data.

Nebula Graph supports multiple types of clients, including a CLI client, a GUI client, and clients developed in popular programming languages. For more information, see the [client list](../14.client/1.nebula-client.md).

## Prerequisites
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ nav:
- Step 1 Install Nebula Graph: 2.quick-start/2.install-nebula-graph.md
- Step 2 Manage Nebula Graph Service: 2.quick-start/5.start-stop-service.md
- Step 3 Connect to Nebula Graph: 2.quick-start/3.connect-to-nebula-graph.md
- Step 4 Use nGQL (CRUD): 2.quick-start/4.nebula-graph-crud.md
- Step 4 Register the Storage Service: 2.quick-start/3.1add-storage-hosts.md
- Step 5 Use nGQL (CRUD): 2.quick-start/4.nebula-graph-crud.md
- nGQL cheatsheet: 2.quick-start/6.cheatsheet-for-ngql.md

- nGQL guide:
Expand Down

0 comments on commit 0ee0e42

Please sign in to comment.