diff --git a/docs-2.0/1.introduction/1.what-is-nebula-graph.md b/docs-2.0/1.introduction/1.what-is-nebula-graph.md
index e9fd4024f94..e664f774017 100644
--- a/docs-2.0/1.introduction/1.what-is-nebula-graph.md
+++ b/docs-2.0/1.introduction/1.what-is-nebula-graph.md
@@ -30,7 +30,7 @@ Nebula Graph 采用 shared-nothing 架构,支持在不停止数据库服务的
### 易开发
-Nebula Graph 提供 Java、Python、C++和 Go 等流行编程语言的客户端,更多客户端仍在开发中。详情请参见 [Nebula Graph clients](../14.client/1.nebula-client.md)。
+Nebula Graph 提供 Java、Python、C++ 和 Go 等流行编程语言的客户端,更多客户端仍在开发中。详情请参见 [Nebula Graph clients](../14.client/1.nebula-client.md)。
### 高可靠访问控制
diff --git a/docs-2.0/1.introduction/2.1.path.md b/docs-2.0/1.introduction/2.1.path.md
index a222bf8cc4f..f1b808f002d 100644
--- a/docs-2.0/1.introduction/2.1.path.md
+++ b/docs-2.0/1.introduction/2.1.path.md
@@ -50,6 +50,6 @@
用户也可以观看视频了解路径的相关概念。
-[Nebula Algorithm](https://www.bilibili.com/video/BV1Uf4y1t72L)(03 分 09 秒)
+[Path](https://www.bilibili.com/video/BV1Uf4y1t72L)(03 分 09 秒)
diff --git a/docs-2.0/1.introduction/2.data-model.md b/docs-2.0/1.introduction/2.data-model.md
index 2318359cac7..f016e925aa4 100644
--- a/docs-2.0/1.introduction/2.data-model.md
+++ b/docs-2.0/1.introduction/2.data-model.md
@@ -27,9 +27,15 @@ Nebula Graph 数据模型使用 6 种基本的数据模型:
- 两点之间可以有多条边。
- 边是有方向的,不存在无向边。
- - 四元组 `<起点 VID、Edge type、边排序值 (Rank)、终点 VID>` 用于唯一标识一条边。边没有 EID。
+ - 四元组 `<起点 VID、Edge type、边排序值 (rank)、终点 VID>` 用于唯一标识一条边。边没有 EID。
- 一条边有且仅有一个 Edge type。
- - 一条边有且仅有一个 rank。其为 int64,默认为 0。
+ - 一条边有且仅有一个 rank,类型为 int64,默认值为 0。
+
+ !!! 关于 rank
+
+ rank 可以用来区分 Edge type、起始点、目的点都相同的边。该值完全由用户自己指定。
+ 读取时必须自行取得全部的 rank 值后排序过滤和拼接。
+ 不支持诸如 `next(), pre(), head(), tail(), max(), min(), lessThan(), moreThan()` 等函数功能,也不能通过创建索引加速访问或者条件过滤。
- 标签(Tag)
diff --git a/docs-2.0/1.introduction/3.nebula-graph-architecture/4.storage-service.md b/docs-2.0/1.introduction/3.nebula-graph-architecture/4.storage-service.md
index 06f7faed244..8793fae60f5 100644
--- a/docs-2.0/1.introduction/3.nebula-graph-architecture/4.storage-service.md
+++ b/docs-2.0/1.introduction/3.nebula-graph-architecture/4.storage-service.md
@@ -26,7 +26,7 @@ Storage 服务是由 nebula-storaged 进程提供的,用户可以根据场景
- Storage interface 层
- Storage 服务的最上层,定义了一系列和图相关的 API。API 请求会在这一层被翻译成一组针对[分片](#数据分片)的 KV 操作,例如:
+ Storage 服务的最上层,定义了一系列和图相关的 API。API 请求会在这一层被翻译成一组针对[分片](#_4)的 KV 操作,例如:
- `getNeighbors`:查询一批点的出边或者入边,返回边以及对应的属性,并且支持条件过滤。
@@ -70,6 +70,7 @@ Nebula Graph 使用自行开发的 KVStore,而不是其他开源 KVStore,原
- 支持多个图空间,不同图空间相互隔离,每个图空间可以设置自己的分片数和副本数。
+
### 属性说明
Nebula Graph 使用强类型 Schema。
@@ -122,6 +123,7 @@ Nebula Graph 使用强类型 Schema。
![data partitioning](https://www-cdn.nebula-graph.com.cn/nebula-blog/DataModel02.png)
+
### 分片算法
分片策略采用**静态 Hash **的方式,即对点 VID 进行取模操作,同一个点的所有 Tag、出边和入边信息都会存储到同一个分片,这种方式极大地提升了查询效率。
@@ -266,6 +268,7 @@ Storage 服务基于 Raft 协议实现的分布式架构,与 HDFS 的分布式
总而言之,Storage 服务更加轻量级,精简了一些功能,架构没有 HDFS 复杂,可以有效提高小块存储的读写性能。
+
diff --git a/docs-2.0/1.introduction/3.vid.md b/docs-2.0/1.introduction/3.vid.md
index 0e3934455a1..ce159b2ae22 100644
--- a/docs-2.0/1.introduction/3.vid.md
+++ b/docs-2.0/1.introduction/3.vid.md
@@ -22,7 +22,7 @@
## VID 使用建议
-- Nebula Graph 1.x 只支持 VID 类型为`INT64`,2.x 支持`INT64`和`FIXED_STRING()`。在`CREATE SPACE`中通过参数`vid_type`可以指定 VID 类型。
+- Nebula Graph 1.x 只支持 VID 类型为`INT64`,从 2.x 开始支持`INT64`和`FIXED_STRING()`。在`CREATE SPACE`中通过参数`vid_type`可以指定 VID 类型。
- 可以使用`id()`函数,指定或引用该点的 VID;
diff --git a/docs-2.0/14.client/1.nebula-client.md b/docs-2.0/14.client/1.nebula-client.md
index ced474b3599..9e7fee2f93a 100644
--- a/docs-2.0/14.client/1.nebula-client.md
+++ b/docs-2.0/14.client/1.nebula-client.md
@@ -14,4 +14,4 @@ Nebula Graph 提供多种类型客户端,便于用户连接、管理 Nebula Gr
!!! note
- 除 Nebula Java 之外,其他客户端暂不支持线程安全(thread-safe)。
+ 客户端暂不支持线程安全(thread-safe)。
diff --git a/docs-2.0/14.client/3.nebula-cpp-client.md b/docs-2.0/14.client/3.nebula-cpp-client.md
index 651b112b2ed..dacaeb3350d 100644
--- a/docs-2.0/14.client/3.nebula-cpp-client.md
+++ b/docs-2.0/14.client/3.nebula-cpp-client.md
@@ -13,8 +13,9 @@
|Nebula Graph 版本|Nebula CPP 版本|
|:---|:---|
|{{ nebula.release }}|{{cpp.release}}|
-|2.0.1|2.0.0|
-|2.0.0|2.0.0|
+|2.6.x|2.5.0|
+|2.5.x|2.5.0|
+|2.0.x|2.0.0|
## 安装 Nebula CPP
@@ -23,7 +24,7 @@
- (推荐)如果需要安装指定版本的 Nebula CPP,请使用选项`--branch`指定分支。例如安装 v{{ cpp.release }}发布版本,请执行如下命令:
```bash
- $ git clone --branch v{{ cpp.release }} https://github.com/vesoft-inc/nebula-cpp.git
+ $ git clone --branch {{cpp.branch}} https://github.com/vesoft-inc/nebula-cpp.git
```
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -82,7 +83,7 @@
将 CPP 文件编译为可执行文件即可。接下来以`SessionExample.cpp`为例,介绍如何操作。
-1. 使用[示例代码](https://github.com/vesoft-inc/nebula-cpp/blob/master/examples/SessionExample.cpp)创建`SessionExample.cpp`文件。
+1. 使用[示例代码](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.branch}}/examples/SessionExample.cpp)创建`SessionExample.cpp`文件。
2. 编译文件,命令如下:
@@ -102,22 +103,5 @@
### 核心代码
-详细示例请参见 [SessionExample](https://github.com/vesoft-inc/nebula-cpp/blob/master/examples/SessionExample.cpp)。
-
-```C++
-nebula::init(&argc, &argv);
-auto address = "192.168.xx.1:9669";
-nebula::ConnectionPool pool;
-pool.init({address}, nebula::Config{});
-auto session = pool.getSession("root", "nebula");
-
-auto result = session.execute("SHOW HOSTS");
-std::cout << *result.data;
-
-std::atomic_bool complete{false};
-session.asyncExecute("SHOW HOSTS", [&complete](nebula::ExecutionResponse&& cbResult) {
- std::cout << *cbResult.data;
- complete.store(true);
-});
-session.release();
-```
+详细示例请参见 [SessionExample](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.branch}}/examples/SessionExample.cpp)。
+
diff --git a/docs-2.0/14.client/4.nebula-java-client.md b/docs-2.0/14.client/4.nebula-java-client.md
index 580e516c929..0b48c20728b 100644
--- a/docs-2.0/14.client/4.nebula-java-client.md
+++ b/docs-2.0/14.client/4.nebula-java-client.md
@@ -11,8 +11,8 @@
|Nebula Graph 版本|Nebula Java 版本|
|:---|:---|
|{{ nebula.release }}|{{java.release}}|
-|2.0.1|2.0.0|
-|2.0.0|2.0.0|
+|2.6.x|2.6.1|
+|2.0.x|2.0.0|
|2.0.0-rc1|2.0.0-rc1|
## 下载 Nebula Java
@@ -20,7 +20,7 @@
- (推荐)如果需要使用指定版本的 Nebula Java,请使用选项`--branch`指定分支。例如使用 v{{ java.release }}发布版本,请执行如下命令:
```bash
- $ git clone --branch v{{ java.release }} https://github.com/vesoft-inc/nebula-java.git
+ $ git clone --branch {{java.branch}} https://github.com/vesoft-inc/nebula-java.git
```
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -39,13 +39,13 @@
!!! note
- `2.0.0-SNAPSHOT`为日常研发版本,可能存在未知问题,建议使用 release 版本号替换`2.0.0-SNAPSHOT`。
+ `3.0.0-SNAPSHOT`为日常研发版本,可能存在未知问题,建议使用 release 版本号替换`3.0.0-SNAPSHOT`。
```bash
com.vesoft
client
- 2.0.0-SNAPSHOT
+ 3.0.0-SNAPSHOT
```
@@ -64,49 +64,5 @@
### 核心代码
-详细示例请参见 [GraphClientExample](https://github.com/vesoft-inc/nebula-java/blob/master/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java)。
-
-```java
-NebulaPool pool = new NebulaPool();
-Session session = null;
-try {
- NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
- nebulaPoolConfig.setMaxConnSize(100);
- List addresses = Arrays.asList(new HostAddress("192.168.xx.1", 9669),
- new HostAddress("192.168.xx.2", 9670));
- pool.init(addresses, nebulaPoolConfig);
- session = pool.getSession("root", "nebula", false);
-
- //create space
- String space = "test";
- String createSpace = "CREATE SPACE IF NOT EXISTS " + space + " (partition_num=15, replica_factor=1, vid_type=fixed_string(30)); ";
- ResultSet resp = session.execute(createSpace);
-
- //create schema
- String createSchema = "USE " + space + "; CREATE TAG IF NOT EXISTS person(name string, age int);"
- + "CREATE EDGE IF NOT EXISTS like(likeness double)";
- ResultSet resp = session.execute(createSchema);
-
- //insert vertex
- String insertVertexes = "INSERT VERTEX person(name, age) VALUES " + "'Bob':('Bob', 10), "
- + "'Lily':('Lily', 9), " + "'Tom':('Tom', 10), " + "'Jerry':('Jerry', 13), "
- + "'John':('John', 11);";
- ResultSet resp = session.execute(insertVertexes);
-
- // inert edge
- String insertEdges = "INSERT EDGE like(likeness) VALUES " + "'Bob'->'Lily':(80.0), "
- + "'Bob'->'Tom':(70.0), " + "'Lily'->'Jerry':(84.0), " + "'Tom'->'Jerry':(68.3), "
- + "'Bob'->'John':(97.2);";
- ResultSet resp = session.execute(insertEdges);
-
- // query
- String query = "GO FROM \"Bob\" OVER like " + "YIELD properties($$).name, properties($$).age, properties(edge).likeness";
- ResultSet resp = session.execute(query);
- printResult(resp);
-}finally {
- if (session != null) {
- session.release();
- }
- pool.close();
-}
-```
+详细示例请参见 [GraphClientExample](https://github.com/vesoft-inc/nebula-java/blob/{{java.branch}}/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java)。
+
diff --git a/docs-2.0/14.client/5.nebula-python-client.md b/docs-2.0/14.client/5.nebula-python-client.md
index 264484a3932..39cafeb3ff9 100644
--- a/docs-2.0/14.client/5.nebula-python-client.md
+++ b/docs-2.0/14.client/5.nebula-python-client.md
@@ -4,15 +4,15 @@
## 前提条件
-已安装 Python,版本为 3.5 及以上。
+已安装 Python,版本为 3.6 及以上。
## 版本对照表
|Nebula Graph 版本|Nebula Python 版本|
|:---|:---|
|{{ nebula.release }}|{{python.release}}|
-|2.0.1|2.0.0|
-|2.0.0|2.0.0|
+|2.6.x|2.6.0|
+|2.0.x|2.0.0|
|2.0.0-rc1|2.0.0rc1|
## 安装 Nebula Python
@@ -20,7 +20,7 @@
### pip 安装
```bash
-$ pip install nebula2-python==
+$ pip install nebula3-python==
```
### 克隆源码安装
@@ -30,7 +30,7 @@ $ pip install nebula2-python==
- (推荐)如果需要安装指定版本的 Nebula Python,请使用选项`--branch`指定分支。例如安装 v{{ python.release }}发布版本,请执行如下命令:
```bash
- $ git clone --branch v{{ python.release }} https://github.com/vesoft-inc/nebula-python.git
+ $ git clone --branch {{python.branch}} https://github.com/vesoft-inc/nebula-python.git
```
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -53,66 +53,5 @@ $ pip install nebula2-python==
## 核心代码
-详细示例请参见 [Example](https://github.com/vesoft-inc/nebula-python/tree/master/example)。
+详细示例请参见 [Example](https://github.com/vesoft-inc/nebula-python/tree/{{python.branch}}/example)。
-### 连接 Graph 服务
-
-```python
-# 定义配置
-config = Config()
-config.max_connection_pool_size = 10
-# 初始化连接池
-connection_pool = ConnectionPool()
-# 如果给定的服务器正常,则返回 true,否则返回 false。
-ok = connection_pool.init([('192.168.xx.1', 9669)], config)
-
-# 方法 1:控制连接自行释放。
-# 从连接池中获取会话
-session = connection_pool.get_session('root', 'nebula')
-
-# 选择图空间
-session.execute('USE basketballplayer')
-
-# 执行查看 TAG 命令
-result = session.execute('SHOW TAGS')
-print(result)
-
-# 释放会话
-session.release()
-
-# 方法 2:使用 session_context,会话将被自动释放。
-with connection_pool.session_context('root', 'nebula') as session:
- session.execute('USE basketballplayer;')
- result = session.execute('SHOW TAGS;')
- print(result)
-
-# 关闭连接池
-connection_pool.close()
-```
-
-### 连接 Storage 服务
-
-```python
-# 设置所有 Meta 服务地址
-meta_cache = MetaCache([('192.168.xx.1', 9559),
- ('192.168.xx.2', 9559),
- ('192.168.xx.3', 9559)],
- 50000)
-graph_storage_client = GraphStorageClient(meta_cache)
-
-resp = graph_storage_client.scan_vertex(
- space_name='ScanSpace',
- tag_name='person')
-while resp.has_next():
- result = resp.next()
- for vertex_data in result:
- print(vertex_data)
-
-resp = graph_storage_client.scan_edge(
- space_name='ScanSpace',
- edge_name='friend')
-while resp.has_next():
- result = resp.next()
- for edge_data in result:
- print(edge_data)
-```
\ No newline at end of file
diff --git a/docs-2.0/14.client/6.nebula-go-client.md b/docs-2.0/14.client/6.nebula-go-client.md
index 2da1e6c6d5b..802f7417ad1 100644
--- a/docs-2.0/14.client/6.nebula-go-client.md
+++ b/docs-2.0/14.client/6.nebula-go-client.md
@@ -11,15 +11,15 @@
|Nebula Graph 版本|Nebula Go 版本|
|:---|:---|
|{{ nebula.release }}|{{go.release}}|
-|2.0.1|2.0.0-GA|
-|2.0.0|2.0.0-GA|
+|2.6.x|2.6.0|
+|2.0.x|2.0.0-GA|
## 下载 Nebula Go
- (推荐)如果需要下载指定版本的 Nebula Go,请使用选项`--branch`指定分支。例如安装 v{{ go.release }}发布版本,请执行如下命令:
```bash
- $ git clone --branch v{{ go.release }} https://github.com/vesoft-inc/nebula-go.git
+ $ git clone --branch {{go.branch}} https://github.com/vesoft-inc/nebula-go.git
```
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -36,43 +36,9 @@
$ go get -u -v github.com/vesoft-inc/nebula-go@
```
-`tag`:指定分支。例如`master`或`v{{ go.release }}`。
+`tag`:指定分支。例如`master`或`{{go.branch}}`。
## 核心代码
-详细示例请参见 [graph_client_basic_example](https://github.com/vesoft-inc/nebula-go/blob/master/basic_example/graph_client_basic_example.go) 和 [graph_client_goroutines_example](https://github.com/vesoft-inc/nebula-go/blob/master/gorountines_example/graph_client_goroutines_example.go)。
+详细示例请参见 [graph_client_basic_example](https://github.com/vesoft-inc/nebula-go/blob/{{go.branch}}/basic_example/graph_client_basic_example.go) 和 [graph_client_goroutines_example](https://github.com/vesoft-inc/nebula-go/blob/{{go.branch}}/gorountines_example/graph_client_goroutines_example.go)。
-```bash
-const (
- address = "192.168.xx.1"
- port = 9669
- username = "root"
- password = "nebula"
-)
-
-func main() {
- hostAddress := nebula.HostAddress{Host: address, Port: port}
- hostList := []nebula.HostAddress{hostAddress}
- testPoolConfig := nebula.GetDefaultConf()
- pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log)
- defer pool.Close()
- session, err := pool.GetSession(username, password)
- defer session.Release()
-
- checkResultSet := func(prefix string, res *nebula.ResultSet) {
- if !res.IsSucceed() {
- log.Fatal(fmt.Sprintf("%s, ErrorCode: %v, ErrorMsg: %s", prefix, res.GetErrorCode(), res.GetErrorMsg()))
- }
- }
- {
- createSchema := "CREATE SPACE IF NOT EXISTS basic_example_space(vid_type=FIXED_STRING(20)); " +
- "USE basic_example_space;" +
- "CREATE TAG IF NOT EXISTS person(name string, age int);" +
- "CREATE EDGE IF NOT EXISTS like(likeness double)"
- resultSet, err := session.Execute(createSchema)
- checkResultSet(createSchema, resultSet)
- }
- fmt.Print("\n")
- log.Info("Nebula Go Client Basic Example Finished")
-}
-```
diff --git a/docs-2.0/15.contribution/how-to-contribute.md b/docs-2.0/15.contribution/how-to-contribute.md
index d294da3b46e..0753e625d6f 100644
--- a/docs-2.0/15.contribution/how-to-contribute.md
+++ b/docs-2.0/15.contribution/how-to-contribute.md
@@ -28,11 +28,11 @@ Nebula Graph 文档以 Markdown 语言编写。单击文档标题右侧的铅笔
### Step 1:通过 GitHub fork 仓库
-Nebula Graph 项目有很多[仓库](https://github.com/vesoft-inc),以 [nebula-graph 仓库](https://github.com/vesoft-inc/nebula)为例:
+Nebula Graph 项目有很多[仓库](https://github.com/vesoft-inc),以 [nebula 仓库](https://github.com/vesoft-inc/nebula)为例:
1. 访问 [github.com/vesoft-inc/nebula](https://github.com/vesoft-inc/nebula)。
-2. 在右上角单击按钮`Fork`,然后单击用户名,即可 fork 出 nebula-graph 仓库。
+2. 在右上角单击按钮`Fork`,然后单击用户名,即可 fork 出 nebula 仓库。
### Step 2:将分支克隆到本地
@@ -54,8 +54,8 @@ Nebula Graph 项目有很多[仓库](https://github.com/vesoft-inc),以 [nebul
```bash
mkdir -p $working_dir
cd $working_dir
- git clone https://github.com/$user/nebula-graph.git
- # 或:git clone git@github.com:$user/nebula-graph.git
+ git clone https://github.com/$user/nebula.git
+ # 或:git clone git@github.com:$user/nebula.git
cd $working_dir/nebula
git remote add upstream https://github.com/vesoft-inc/nebula.git
@@ -66,8 +66,8 @@ Nebula Graph 项目有很多[仓库](https://github.com/vesoft-inc),以 [nebul
# 确认远程分支有效。
# 正确的格式为:
- # origin git@github.com:$(user)/nebula-graph.git (fetch)
- # origin git@github.com:$(user)/nebula-graph.git (push)
+ # origin git@github.com:$(user)/nebula.git (fetch)
+ # origin git@github.com:$(user)/nebula.git (push)
# upstream https://github.com/vesoft-inc/nebula (fetch)
# upstream no_push (push)
git remote -v
@@ -80,14 +80,14 @@ Nebula Graph 项目有很多[仓库](https://github.com/vesoft-inc),以 [nebul
hook 将检查 commit,包括格式、构建、文档生成等。
```bash
- cd $working_dir/nebula-graph/.git/hooks
- ln -s $working_dir/nebula-graph/.linters/cpp/hooks/pre-commit.sh .
+ cd $working_dir/nebula/.git/hooks
+ ln -s $working_dir/nebula/.linters/cpp/hooks/pre-commit.sh .
```
pre-commit hook 有时候可能无法正常执行,用户必须手动执行。
```bash
- cd $working_dir/nebula-graph/.git/hooks
+ cd $working_dir/nebula/.git/hooks
chmod +x pre-commit
```
@@ -177,7 +177,7 @@ git push origin myfeature
### Step 8:创建 pull request
-1. 访问 fork 出的仓库`https://github.com/$user/nebula-graph` (替换此处的用户名`$user`)。
+1. 访问 fork 出的仓库`https://github.com/$user/nebula` (替换此处的用户名`$user`)。
2. 单击`myfeature`分支旁的按钮`Compare & pull request`。
diff --git a/docs-2.0/2.quick-start/1.quick-start-workflow.md b/docs-2.0/2.quick-start/1.quick-start-workflow.md
index f4db47ee898..882f09d8f62 100644
--- a/docs-2.0/2.quick-start/1.quick-start-workflow.md
+++ b/docs-2.0/2.quick-start/1.quick-start-workflow.md
@@ -28,9 +28,12 @@
### 热点视频
+
+
* [Foesa 小学姐课堂——Nebula Graph 那些磨人的概念](https://www.bilibili.com/video/BV1Q5411K7Gg)(04 分 20 秒)
@@ -39,19 +42,24 @@
* [Foesa 小学姐课堂——path 的三种类型](https://www.bilibili.com/video/BV1Uf4y1t72L)(03 分 09 秒)
+
+
### NG 辅导班
diff --git a/docs-2.0/2.quick-start/4.nebula-graph-crud.md b/docs-2.0/2.quick-start/4.nebula-graph-crud.md
index e72458bfad4..7d1e9531621 100644
--- a/docs-2.0/2.quick-start/4.nebula-graph-crud.md
+++ b/docs-2.0/2.quick-start/4.nebula-graph-crud.md
@@ -27,15 +27,26 @@
## 管理 Nebula Graph 集群的 Storage 节点
-首先将 Storage 节点加入 Nebula Graph 集群。更多管理集群命令请参见 [管理逻辑机架(Zone)](../4.deployment-and-installation/5.zone.md)。
+首先将 Storage 节点加入 Nebula Graph 集群。
+
+
+
!!! compatibility
- 从 3.0 版本开始,在配置文件中添加的 Storage 节点无法直接读写,配置文件的作用仅仅是将 Storage 节点注册至 Meta 服务中。必须使用`ADD HOSTS`命令后,才能正常读写 Storage 节点。
+ 从 3.0.0 版本开始,在配置文件中添加的 Storage 节点无法直接读写,配置文件的作用仅仅是将 Storage 节点注册至 Meta 服务中。必须使用`ADD HOSTS`命令后,才能正常读写 Storage 节点。
+
+```ngql
+ADD HOSTS : [,: ...];
+```
+
示例:
@@ -51,14 +62,13 @@ Storage 服务加入集群后,可以执行命令`SHOW HOSTS`查看机器状态
```ngql
nebula> SHOW HOSTS;
-+------------------+------+----------+--------------+----------------------+------------------------+
-| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
-+------------------+------+----------+--------------+----------------------+------------------------+
-| "192.168.10.100" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
-| "192.168.10.101" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
-| "192.168.10.102" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
-| "Total" | | | 0 | | |
-+------------------+------+----------+--------------+----------------------+------------------------+
++------------------+------+----------+--------------+----------------------+------------------------+---------+
+| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
++------------------+------+----------+--------------+----------------------+------------------------+---------+
+| "192.168.10.100" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
+| "192.168.10.101" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
+| "192.168.10.102" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
++------------------+------+----------+--------------+----------------------+------------------------+---------+
```
在返回结果中,查看 **Status** 列,可以看到所有 Storage 服务都在线。
@@ -93,11 +103,8 @@ nebula> SHOW HOSTS;
[replica_factor = ,]
vid_type = {FIXED_STRING() | INT64}
)
- [ON zone_list]
- [COMMENT = ''];
- zone_list:
- "zone_name" [,"zone_name" ...]
+ [COMMENT = ''];
```
参数详情请参见 [CREATE SPACE](../3.ngql-guide/9.space-statements/1.create-space.md)。
@@ -131,14 +138,13 @@ nebula> SHOW HOSTS;
```ngql
nebula> SHOW HOSTS;
- +-------------+-----------+-----------+--------------+----------------------------------+------------------------+
- | Host | Port | Status | Leader count | Leader distribution | Partition distribution |
- +-------------+-----------+-----------+--------------+----------------------------------+------------------------+
- | "storaged0" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
- | "storaged1" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
- | "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
- | "Total" | | | 15 | "basketballplayer:15" | "basketballplayer:15" |
- +-------------+-----------+-----------+--------------+----------------------------------+------------------------+
+ +-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
+ | Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+ +-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
+ | "storaged0" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
+ | "storaged1" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
+ | "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
+ +-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
```
如果** Leader distribution **分布不均匀,请执行命令`BALANCE LEADER`重新分配。更多信息,请参见 [Storage 负载均衡](../8.service-tuning/load-balance.md)。
@@ -165,9 +171,14 @@ nebula> SHOW HOSTS;
### nGQL 语法
```ngql
-CREATE {TAG | EDGE} { | }(
-[, ...])
-[COMMENT = ''];
+CREATE {TAG | EDGE} [IF NOT EXISTS] { | }
+ (
+ [NULL | NOT NULL] [DEFAULT ] [COMMENT '']
+ [{, [NULL | NOT NULL] [DEFAULT ] [COMMENT '']} ...]
+ )
+ [TTL_DURATION = ]
+ [TTL_COL = ]
+ [COMMENT = ''];
```
参数详情请参见 [CREATE TAG](../3.ngql-guide/10.tag-statements/1.create-tag.md) 和 [CREATE EDGE](../3.ngql-guide/11.edge-type-statements/1.create-edge.md)。
@@ -202,19 +213,33 @@ nebula> CREATE EDGE serve(start_year int, end_year int);
- 插入点
```ngql
- INSERT VERTEX [IF NOT EXISTS] [ (] [, ...])
- [, ([, ...]), ...]
- VALUES : ([[, ...]]);
+ INSERT VERTEX [IF NOT EXISTS] [tag_props, [tag_props] ...]
+ VALUES : ([prop_value_list])
+
+ tag_props:
+ tag_name ([prop_name_list])
+
+ prop_name_list:
+ [prop_name [, prop_name] ...]
+
+ prop_value_list:
+ [prop_value [, prop_value] ...]
```
- `VID`是 Vertex ID 的缩写,`VID`在一个图空间中是唯一的。参数详情请参见 [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md)。
+ `vid`是 Vertex ID 的缩写,`vid`在一个图空间中是唯一的。参数详情请参见 [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md)。
- 插入边
```ngql
- INSERT EDGE [IF NOT EXISTS] ([, ...])
- VALUES -> [@] : ([, ...])
- [, -> [@] : ([, ...]), ...];
+ INSERT EDGE [IF NOT EXISTS] ( ) VALUES
+ -> [@] : ( )
+ [, -> [@] : ( ), ...];
+
+ ::=
+ [ [, ] ...]
+
+ ::=
+ [ [, ] ...]
```
参数详情请参见 [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md)。
@@ -262,10 +287,10 @@ nebula> CREATE EDGE serve(start_year int, end_year int);
```ngql
GO [[ TO] STEPS ] FROM
OVER [{REVERSELY | BIDIRECT}]
- [ WHERE ]
- YIELD [DISTINCT]
- [{SAMPLE | LIMIT }]
- [| GROUP BY {col_name | expr | position} YIELD ]
+ [ WHERE ]
+ YIELD [DISTINCT]
+ [{ SAMPLE | }]
+ [| GROUP BY { | expression> | } YIELD ]
[| ORDER BY [{ASC | DESC}]]
[| LIMIT [,] ];
```
@@ -293,12 +318,15 @@ nebula> CREATE EDGE serve(start_year int, end_year int);
LOOKUP ON { | }
[WHERE [AND ...]]
YIELD [AS ];
+
+
+ [AS ] [, [AS ] ...];
```
- `MATCH`
```nGQL
- MATCH [] RETURN