Skip to content

Commit

Permalink
Create 0.FAQ.md (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitewum committed Feb 8, 2022
1 parent 7f1c3e0 commit dec6e06
Showing 1 changed file with 128 additions and 121 deletions.
249 changes: 128 additions & 121 deletions docs-2.0/20.appendix/0.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ Nebula Graph 一直在持续开发,功能或操作的行为可能会有变化
Neubla Graph {{ nebula.release }} 与 Nebula Graph {{ nebula.base20 }} 的数据格式兼容,客户端不兼容。
-->

## 关于执行
## 关于执行报错

### 为什么 Nebula Graph 2.6.0 的返回结果每行之间没有横线分隔了?
### 如何处理错误信息 `SemanticError: Missing yield clause.`

这是 Nebula Console 2.6.0 版本的变动造成的,不是 Nebula Graph 内核的变更,不影响返回数据本身的内容
Nebula Graph 3.0.0 开始,查询语句`LOOKUP``GO``FETCH`必须用`YIELD`子句指定输出结果。详情请参见[YIELD](../3.ngql-guide/8.clauses-and-options/yield.md)

### 关于悬挂边
<!--
### 如何处理错误信息 `Zone not enough!`
悬挂边 (Dangling edge) 是指一条边的起点或者终点在数据库中不存在。
从 3.0.0 版本开始,在配置文件中添加的 Storage 节点无法直接读写,配置文件的作用仅仅是将 Storage 节点注册至 Meta 服务中。必须使用`ADD HOSTS`命令后,才能正常读写 Storage 节点。详情参见[管理逻辑机架(Zone)](../4.deployment-and-installation/5.zone.md)。
-->

### 如何处理错误信息 `To get the property of the vertex in 'v.age', should use the format 'var.tag.prop'`

Nebula Graph {{ nebula.release }} 的数据模型中,由于设计允许图中存在“悬挂边”;没有 openCypher 中的 MERGE 语句。对于悬挂边的保证完全依赖应用层面。详见 [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md), [DELETE VERTEX](../3.ngql-guide/12.vertex-statements/4.delete-vertex.md), [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md), [DELETE EDGE](../3.ngql-guide/13.edge-statements/4.delete-edge.md)
从 3.0.0 版本开始,`pattern`支持同时匹配多个 Tag,所以返回属性时,需要额外指定 Tag 名称。即从`RETURN 变量名.属性名`改为`RETURN 变量名.Tag名.属性名`

### 如何处理错误信息 `[ERROR (-1005)]: Used memory hits the high watermark(0.800000) of total system memory.`

Expand All @@ -53,10 +57,6 @@ Nebula Graph {{ nebula.release }} 的数据模型中,由于设计允许图中
* 清理系统内存,使其降低到阈值以下。
* [修改 Graph 配置](../5.configurations-and-logs/1.configurations/1.configurations.md)。在所有 Graph 服务器的配置文件中增加`system_memory_high_watermark_ratio`参数,为其设置一个大于`0.8`的值,例如`0.9`

!!! note

仅 Graph 服务支持`system_memory_high_watermark_ratio`,Storage 和 Meta 服务不支持该参数。

### 如何处理错误信息 `Storage Error E_RPC_FAILURE`

报错原因通常为 Graph 服务向 Storage 服务请求了过多的数据,导致 Storage 服务超时。请尝试以下解决方案:
Expand All @@ -71,20 +71,108 @@ Nebula Graph {{ nebula.release }} 的数据模型中,由于设计允许图中

已知问题,通常需要重试 1-N 次 (N==partition 数量)。原因为 meta client 更新 leader 缓存需要 1-2 个心跳或者通过错误触发强制更新。

### 如何处理错误信息 `SemanticError: Missing yield clause.`
### [ERROR (-1005)]: Schema not exist: xxx

从 Nebula Graph 3.0.0 开始,查询语句`LOOKUP``GO``FETCH`必须用`YIELD`子句指定输出结果。详情请参见[YIELD](../3.ngql-guide/8.clauses-and-options/yield.md)
查询时提示`Schema not exist`,请确认:

<!--
### 如何处理错误信息 `Zone not enough!`
- Schema 中是否存在该 Tag 或 Edge type。

从 3.0.0 版本开始,在配置文件中添加的 Storage 节点无法直接读写,配置文件的作用仅仅是将 Storage 节点注册至 Meta 服务中。必须使用`ADD HOSTS`命令后,才能正常读写 Storage 节点。详情参见[管理逻辑机架(Zone)](../4.deployment-and-installation/5.zone.md)。
-->
- Tag 或 Edge type 的名称是否为关键字,如果是关键字,请使用反引号(\`)将它们括起来。详情请参见[关键字](../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md)

### 编译 Exchange、Connectors、Algorithm 时无法下载 SNAPSHOT 包

### 如何处理错误信息 `To get the property of the vertex in 'v.age', should use the format 'var.tag.prop'`
现象:编译时提示`Could not find artifact com.vesoft:client:jar:xxx-SNAPSHOT`

原因:本地 maven 没有配置用于下载 SNAPSHOT 的仓库。maven 中默认的 central 仓库用于存放正式发布版本,而不是开发版本(SNAPSHOT)。

解决方案:在 maven 的 setting.xml文件的`profiles`作用域内中增加以下配置:

```
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
```

### 如何处理错误信息`[ERROR (-7)]: SyntaxError: syntax error near`

大部分情况下,查询语句需要有`YIELD``RETURN`,请检查查询语句是否包含。



### 如何处理错误信息`can’t solve the start vids from the sentence`

查询引擎需要知道从哪些 VID 开始图遍历。这些开始图遍历的 VID,或者通过用户指定,例如:

```ngql
> GO FROM ${vids} ...
> MATCH (src) WHERE id(src) == ${vids}
# 开始图遍历的 VID 通过如上办法指定
```

或者通过一个属性索引来得到,例如:

```ngql
# CREATE TAG INDEX IF NOT EXISTS i_player ON player(name(20));
# REBUILD TAG INDEX i_player;
> LOOKUP ON player WHERE player.name == "abc" | ... YIELD ...
> MATCH (src) WHERE src.name == "abc" ...
# 通过点属性 name 的索引,来得到 VID
```

否则,就会抛出这样一个异常 `can’t solve the start vids from the sentence`

### 如何处理错误信息`Wrong vertex id type: 1001`

检查输入的 VID 类型是否是`create space`设置的`INT64``FIXED_STRING(N)`。详情请参见 [create space](../3.ngql-guide/9.space-statements/1.create-space.md)

### 如何处理错误信息`The VID must be a 64-bit integer or a string fitting space vertex id length limit.`

检查输入的 VID 是否超过限制长度。详情请参见 [create space](../3.ngql-guide/9.space-statements/1.create-space.md)

### 如何处理错误信息 `edge conflict``vertex conflict`

Storage 服务在毫秒级时间内多次收到插入或者更新同一点或边的请求时,可能返回该错误。请稍后重试。

### 如何处理错误信息 `RPC failure in MetaClient: Connection refused`

报错原因通常为 metad 服务状态异常,或是 metad 和 graphd 服务所在机器网络不通。请尝试以下解决方案:

- 在 metad 所在服务器查看下 metad 服务状态,如果服务状态异常,可以重新启动 metad 服务。

- 在报错服务器下使用`telnet meta-ip:port`查看网络状态。

- 检查配置文件中的端口配置,如果端口号与连接时使用的不同,改用配置文件中的端口或者修改配置。

### 如何处理 `nebula-graph.INFO` 中错误日志 `StorageClientBase.inl:214] Request to "x.x.x.x":9779 failed: N6apache6thrift9transport19TTransportExceptionE: Timed Out`

报错原因可能是查询的数据量比较大,storaged 处理超时。请尝试以下解决方法:

- 导入数据时,手动 [compaction](../8.service-tuning/compaction.md),加速读的速度。

- 增加 Graph 服务与 Storage 服务的 RPC 连接超时时间,在`nebula-storaged.conf`文件里面修改`--storage_client_timeout_ms`参数的值。该值的单位为毫秒(ms),默认值为 60000 毫秒。

<!--提示:请在配置文件开头添加--local_config=true 再重启服务。-->

### 如何处理 `nebula-storaged.INFO` 中错误日志 `MetaClient.cpp:65] Heartbeat failed, status:Wrong cluster!` 或者 `nebula-metad.INFO` 含有错误日志`HBProcessor.cpp:54] Reject wrong cluster host "x.x.x.x":9771!`

报错的原因可能是用户修改了 metad 的 ip 或者端口信息,或者 storage 之前加入过其他集群。请尝试以下解决方法:

用户到 storage 部署的机器所在的安装目录(默认安装目录为 `/usr/local/nebula`)下面将`cluster.id`文件删除,然后重启 storaged 服务。

从 3.0.0 版本开始,`pattern`支持同时匹配多个 Tag,所以返回属性时,需要额外指定 Tag 名称。即从`RETURN 变量名.属性名`改为`RETURN 变量名.Tag名.属性名`

## 关于设计与功能

### 返回消息中 `time spent` 的含义是什么?

Expand All @@ -104,6 +192,19 @@ Got 1 rows (time spent 1235/1934 us)

- 第二个数字`1934`表示从客户端角度看所花费的时间,即从客户端发送请求、接收结果,然后在屏幕上显示结果所花费的时间。

### 为什么 Nebula Graph 的返回结果每行之间没有横线分隔了?

这是 Nebula Console 2.6.0 版本的变动造成的,不是 Nebula Graph 内核的变更,不影响返回数据本身的内容。

### 关于悬挂边

悬挂边 (Dangling edge) 是指一条边的起点或者终点在数据库中不存在。

Nebula Graph {{ nebula.release }} 的数据模型中,由于设计允许图中存在“悬挂边”;
没有 openCypher 中的 MERGE 语句。
对于悬挂边的保证完全依赖应用层面。
详见 [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md), [DELETE VERTEX](../3.ngql-guide/12.vertex-statements/4.delete-vertex.md), [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md), [DELETE EDGE](../3.ngql-guide/13.edge-statements/4.delete-edge.md)

### 可以在`CREATE SPACE`时设置`replica_factor`为偶数(例如设置为 2)吗?

不要这样设置。
Expand Down Expand Up @@ -148,10 +249,6 @@ Storage 服务使用 Raft 协议(多数表决),为保证可用性,要求

关于路径的详细说明,请参见[维基百科](https://en.wikipedia.org/wiki/Path_(graph_theory)#Walk,_trail,_path)

### 如何处理错误信息`[ERROR (-7)]: SyntaxError: syntax error near`

大部分情况下,查询语句需要有`YIELD``RETURN`,请检查查询语句是否包含。

### 如何统计每种 Tag 有多少个点,每个 Edge type 有多少条边?

请参见 [show-stats](../3.ngql-guide/7.general-query-statements/6.show/14.show-stats.md)
Expand Down Expand Up @@ -186,67 +283,6 @@ nGQL 没有该功能。

或者指定各 Tag/Edge Type,然后再自己通过 `Union` 拼装。

### 如何处理错误信息`can’t solve the start vids from the sentence`

查询引擎需要知道从哪些 VID 开始图遍历。这些开始图遍历的 VID,或者通过用户指定,例如:

```ngql
> GO FROM ${vids} ...
> MATCH (src) WHERE id(src) == ${vids}
# 开始图遍历的 VID 通过如上办法指定
```

或者通过一个属性索引来得到,例如:

```ngql
# CREATE TAG INDEX IF NOT EXISTS i_player ON player(name(20));
# REBUILD TAG INDEX i_player;
> LOOKUP ON player WHERE player.name == "abc" | ... YIELD ...
> MATCH (src) WHERE src.name == "abc" ...
# 通过点属性 name 的索引,来得到 VID
```

否则,就会抛出这样一个异常 `can’t solve the start vids from the sentence`

### 如何处理错误信息`Wrong vertex id type: 1001`

检查输入的 VID 类型是否是`create space`设置的`INT64``FIXED_STRING(N)`。详情请参见 [create space](../3.ngql-guide/9.space-statements/1.create-space.md)

### 如何处理错误信息`The VID must be a 64-bit integer or a string fitting space vertex id length limit.`

检查输入的 VID 是否超过限制长度。详情请参见 [create space](../3.ngql-guide/9.space-statements/1.create-space.md)

### 如何处理错误信息 `edge conflict``vertex conflict`

Storage 服务在毫秒级时间内多次收到插入或者更新同一点或边的请求时,可能返回该错误。请稍后重试。

### 如何处理错误信息 `RPC failure in MetaClient: Connection refused`

报错原因通常为 metad 服务状态异常,或是 metad 和 graphd 服务所在机器网络不通。请尝试以下解决方案:

- 在 metad 所在服务器查看下 metad 服务状态,如果服务状态异常,可以重新启动 metad 服务。

- 在报错服务器下使用`telnet meta-ip:port`查看网络状态。

- 检查配置文件中的端口配置,如果端口号与连接时使用的不同,改用配置文件中的端口或者修改配置。

### 如何处理 `nebula-graph.INFO` 中错误日志 `StorageClientBase.inl:214] Request to "x.x.x.x":9779 failed: N6apache6thrift9transport19TTransportExceptionE: Timed Out`

报错原因可能是查询的数据量比较大,storaged 处理超时。请尝试以下解决方法:

- 导入数据时,手动 [compaction](../8.service-tuning/compaction.md),加速读的速度。

- 增加 Graph 服务与 Storage 服务的 RPC 连接超时时间,在`nebula-storaged.conf`文件里面修改`--storage_client_timeout_ms`参数的值。该值的单位为毫秒(ms),默认值为 60000 毫秒。

<!--提示:请在配置文件开头添加--local_config=true 再重启服务。-->

### 如何处理 `nebula-storaged.INFO` 中错误日志 `MetaClient.cpp:65] Heartbeat failed, status:Wrong cluster!` 或者 `nebula-metad.INFO` 含有错误日志`HBProcessor.cpp:54] Reject wrong cluster host "x.x.x.x":9771!`

报错的原因可能是用户修改了 metad 的 ip 或者端口信息,或者 storage 之前加入过其他集群。请尝试以下解决方法:

用户到 storage 部署的机器所在的安装目录(默认安装目录为 `/usr/local/nebula`)下面将`cluster.id`文件删除,然后重启 storaged 服务。

### 能不能用中文字符做标识符,比如图空间、Tag、Edge type、属性、索引的名称?

能,详情参见[关键字和保留字](../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md)
Expand All @@ -266,49 +302,18 @@ nebula > MATCH (s)<-[e]-() WHERE id(s) == "given" RETURN count(e); #入度

可以使用 [Nebula Algorithm](../nebula-algorithm.md)

### [ERROR (-1005)]: Schema not exist: xxx

查询时提示`Schema not exist`,请确认:

- Schema 中是否存在该 Tag 或 Edge type。

- Tag 或 Edge type 的名称是否为关键字,如果是关键字,请使用反引号(\`)将它们括起来。详情请参见[关键字](../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md)

### 编译 Exchange、Connectors、Algorithm 时无法下载 SNAPSHOT 包

现象:编译时提示`Could not find artifact com.vesoft:client:jar:xxx-SNAPSHOT`

原因:本地 maven 没有配置用于下载 SNAPSHOT 的仓库。maven 中默认的 central 仓库用于存放正式发布版本,而不是开发版本(SNAPSHOT)。

解决方案:在 maven 的 setting.xml文件的`profiles`作用域内中增加以下配置:

```
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
```

## 关于运维

### 日志文件过大时如何回收日志?

<!--
Nebula Graph 的日志默认在 `/usr/local/nebula/logs/` 下,正常 INFO 级别日志文件为 `nebula-graphd.INFO, nebula-storaged.INFO, nebula-metad.INFO`,报警和错误级别后缀为 `.WARNING` 和 `.ERROR`。
Nebula Graph 使用 [glog](https://github.com/google/glog) 打印日志。glog 没有日志回收的功能,用户可以:
- 使用 crontab 设置定期任务回收日志文件,详情请参见 [Glog should delete old log files automatically](https://github.com/google/glog/issues/423)。
- 使用 [logrotate](https://github.com/logrotate/logrotate) 实现日志轮询。使用 logrotate 管理日志前需修改相应 Nebula Graph 服务的配置,将`timestamp_in_logfile_name`参数的值改成`false`。
-->

### 如何查看 Nebula Graph 版本

Expand All @@ -318,7 +323,6 @@ Nebula Graph 使用 [glog](https://github.com/google/glog) 打印日志。glog

```bash
$ ./nebula-graphd --version
nebula-graphd version 2.5.0, Git: c397299c, Build Time: Aug 19 2021 11:20:18
```

- Docker Compose 部署
Expand All @@ -337,11 +341,11 @@ nebula-graphd version 2.5.0, Git: c397299c, Build Time: Aug 19 2021 11:20:18

### 如何扩缩容

用户可以使用 Dashboard(企业版),在可视化页面对 graphd 和 storaged 进行快速扩缩容,详情参见[集群操作-扩缩容](../nebula-dashboard-ent/4.cluster-operator/4.manage.md)
用户可以使用 Dashboard(企业版),在可视化页面对 graphd <!--和 storaged --> 进行快速扩缩容,详情参见[集群操作-扩缩容](../nebula-dashboard-ent/4.cluster-operator/4.manage.md)

Nebula Graph {{ nebula.release }} 未提供运维命令以实现自动扩缩容,参考以下步骤:

- metad 的扩容和缩容: metad 不支持扩缩容,也不支持迁移到新机器,也不要增加新的 metad 进程
- metad 的扩容和缩容: metad 不支持自动扩缩容

!!! note

Expand All @@ -351,12 +355,15 @@ Nebula Graph {{ nebula.release }} 未提供运维命令以实现自动扩缩容

- graphd 的扩容: 在新机器上准备 graphd 二进制文件和配置文件,在配置文件中修改或增加已在运行的 metad 地址,启动 graphd 进程。

- storaged 不支持扩缩容。

<!-- balance-3.1
- storaged 的缩容:(副本数都必须大于 1),参考[缩容命令](../8.service-tuning/load-balance.md#storage_1)。完成后关闭 storaged 进程。
- storaged 的扩容:(副本数都必须大于 1) 在新机器上准备 storaged 二进制文件和配置文件,在配置文件中修改或增加已在运行的 metad 地址,启动 storaged 进程。
<!-- balance-3.1
storaged 扩缩容之后,还需要运行 [Balance Data 和 Balance Leader 命令](../8.service-tuning/load-balance.md)。
storaged 扩缩容之后,还需要运行 [Balance Data 和 Balance Leader 命令](../8.service-tuning/load-balance.md)。
-->

### 修改 Host 名称后,旧的 Host 一直显示 `OFFLINE` 怎么办?
Expand Down

0 comments on commit dec6e06

Please sign in to comment.