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

Optimize quick start guide #1628

Merged
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
8 changes: 6 additions & 2 deletions docs-2.0/2.quick-start/1.quick-start-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

启动 Nebula Graph 服务后即可使用客户端连接。Nebula Graph 支持多种客户端,快速入门中介绍使用原生命令行客户端 Nebula Console 连接 Nebula Graph 的方法。

4. [使用常用 nGQL(CRUD 命令)](4.nebula-graph-crud.md)
4. [注册 Storage 服务](3.1add-storage-hosts.md)

连接到 Nebula Graph 之后即可使用 nGQL(Nebula Graph Query Language)进行增删改查。
首次连接 Nebula Graph 后需要先注册 Storage 服务才能正常查询数据。

5. [使用常用 nGQL(CRUD 命令)](4.nebula-graph-crud.md)

注册 Storage 服务之后即可使用 nGQL(Nebula Graph Query Language)进行增删改查。

## 视频

Expand Down
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 @@
# 注册 Storage 服务

首次连接到 Nebula Graph 后,需要先添加 Storage 主机,并确认主机都处于在线状态。

!!! compatibility

- 从 Nebula Graph 3.0.0 版本开始,必须先使用`ADD HOSTS`添加主机,才能正常通过 Storage 服务读写数据。
- 在此前的版本中,无需执行该操作。

## 前提条件

已[连接 Nebula Graph 服务](3.connect-to-nebula-graph.md)。
randomJoe211 marked this conversation as resolved.
Show resolved Hide resolved

## 操作步骤

1. 添加 Storage 主机。

执行如下命令添加主机:

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

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

示例:

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

2. 检查主机状态,确认全部在线。

```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" |
+------------------+------+-----------+----------+--------------+---------------------- +------------------------+---------+
```

在返回结果的 **Status** 列,可以看到所有 Storage 主机都在线。
48 changes: 0 additions & 48 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,54 +25,6 @@

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

## 管理 Nebula Graph 集群的 Storage 节点

首先将 Storage 节点加入 Nebula Graph 集群。

<!--
更多管理集群命令请参见 [管理逻辑机架(Zone)](../4.deployment-and-installation/5.zone.md)。
-->


!!! compatibility

从 3.0.0 版本开始,在配置文件中添加的 Storage 节点无法直接读写,配置文件的作用仅仅是将 Storage 节点注册至 Meta 服务中。必须使用`ADD HOSTS`命令后,才能正常读写 Storage 节点。

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

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

示例:

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



## 检查 Nebula Graph 集群的机器状态

Storage 服务加入集群后,可以执行命令`SHOW HOSTS`查看机器状态。

```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" |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```

在返回结果中,查看 **Status** 列,可以看到所有 Storage 服务都在线。

### 异步实现创建和修改

!!! caution
Expand Down
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 @@
本文介绍如何使用原生命令行客户端 Nebula Console 连接 Nebula Graph。

!!! caution

首次连接到 Nebula Graph 后,必须先[注册 Storage 服务](../2.quick-start/3.1add-storage-hosts.md),才能正常查询数据。

Nebula Graph 支持多种类型的客户端,包括命令行客户端、可视化界面客户端和流行编程语言客户端。详情参见[客户端列表](../14.client/1.nebula-client.md)。

## 前提条件
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ nav:
- 步骤1:安装 Nebula Graph: 2.quick-start/2.install-nebula-graph.md
- 步骤2:启动 Nebula Graph: 2.quick-start/5.start-stop-service.md
- 步骤3:连接 Nebula Graph: 2.quick-start/3.connect-to-nebula-graph.md
- 步骤4:使用常用命令: 2.quick-start/4.nebula-graph-crud.md
- 步骤4:注册 Storage 服务: 2.quick-start/3.1add-storage-hosts.md
- 步骤5:使用常用命令: 2.quick-start/4.nebula-graph-crud.md
- nGQL 命令汇总: 2.quick-start/6.cheatsheet-for-ngql-command.md

- nGQL 指南:
Expand Down