Skip to content

Commit

Permalink
migrate data (#155)
Browse files Browse the repository at this point in the history
* migrate data

* update command
  • Loading branch information
Amber1990Zhang committed Jan 21, 2021
1 parent 1de3cc6 commit 96865ef
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions docs/manual-CN/1.overview/2.quick-start/2.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ curl http://192.168.8.40:13000/status

Nebula Graph 的配置机制较为复杂,简单的说有两种方式:读取本地配置文件,或者通过命令行控制。为避免错误,**两者只可选其一,不要混合使用**

#### 本地配置文件 (适合新用户)
### 本地配置文件 (适合新用户)

配置文件默认在 `/usr/local/nebula/etc/` 下。

在三个配置文件中都加上一行 `--local-config=true`,这样程序启动时将只依赖于配置文件。

详细参数项见:[graphd 参数](../../3.build-develop-and-administration/3.configurations/4.graph-config.md)[storaged 参数](../../3.build-develop-and-administration/3.configurations/5.storage-config.md)

#### 命令行控制调整参数(适合高级用户)
### 命令行控制调整参数(适合高级用户)

在console 中运行如下命令。

Expand Down Expand Up @@ -107,6 +107,22 @@ partition 分布不均会导致部分主机压力过大,参考[这里](../../3

多块硬盘时可以逗号分隔多个目录,每个目录对应一个 RocksDB 实例,以有更好的并发能力。参考[这里](../../3.build-develop-and-administration/3.configurations/5.storage-config.md)

### 数据迁移

如需将已部署完毕的数据导入至新的机器,且原机器不再使用,请将原机器 Storage 服务 `data_path` 目录下的底层数据复制到新机器。运行以下命令更新 Storage 服务:

```bash
curl "http:/new_meta/replace?from=old_storage&to=new_storage"
```

其中,`new_meta` 为新机器 Storage 服务对应的 Meta 服务的 IP 和端口号。`old_storage` 为旧机器 Storage 服务的 IP 和端口号。`new_storage` 为新机器 Storage 服务的 IP 和端口号。例如:

```bash
curl "http://33.33.33.33:11000/replace?from=44.44.44.44:5000&to=55.55.55.55:6000"
```

如果有多个 Meta 服务,`curl` 命令需发至 Meta 服务的 leader。

## 常见错误排查

### 连接失败,报错 Connection refused
Expand Down Expand Up @@ -137,7 +153,7 @@ $ telnet $ip $port
$ /usr/local/nebula/scripts/nebula.service status all
```

#### 进程未启动或者 crash
### 进程未启动或者 crash

- 检查硬盘空间 `df -h`

Expand All @@ -149,26 +165,26 @@ $ /usr/local/nebula/scripts/nebula.service status all

- 检查日志,在 `/usr/local/nebula/logs/`

#### 发生 storaged OOM
### 发生 storaged OOM

1. 检查资源规划是否足够,详细参考[运行配置要求](../../3.build-develop-and-administration/3.configurations/0.system-requirement.md)
2.`/usr/local/nebula/etc/nebula-storaged.conf` 中设置 `--enable_partitioned_index_filter=true``--local-config=true`
3. 检查 partition 分布。
4. 设置读取[截断参数](../../3.build-develop-and-administration/3.configurations/5.storage-config.md)。只返回部分数据。
5. 恢复 storaged 进程后,还需重启 graphd。

#### 已知缺陷:storaged 发生重启后,需要将 graphd 也重启
### 已知缺陷:storaged 发生重启后,需要将 graphd 也重启

否则后续每个请求会失败若干次(最大不超过 partition 数量)。

其原因是: storaged 重启导致的 partition leader 切换,而 graphd 无法自动感知该切换,需通过重启 graphd 以更新 leader 分布信息。

#### 发生 graphd OOM
### 发生 graphd OOM

通常情况为单个查询过大。由于 **Nebula Graph** 的设计是每一个查询只会由一个 graphd 处理,并从多个 storaged 获取数据。
因此,当发生大查询(例如,很深的路径探索,或者返回极大量的数据)时,graphd 可能会发生 OOM。

#### 主机先后加入过两个不同集群 (wrong cluster)
### 主机先后加入过两个不同集群 (wrong cluster)

同一台主机先后用于单机测试和集群测试,storaged 服务无法正常启动(终端上显示的 storaged 服务的监听端口为红色)。查看 storaged 服务的日志(`/usr/local/nebula/nebula-storaged.ERROR`),若发现 "wrong cluster" 的报错信息,则可能的出错原因是单机测试和集群测试时的 Nebula Graph 生成的 cluster id 不一致,需要删除 Nebula Graph 安装目录(`/usr/local/nebula`)下的 `cluster.id` 文件和 `data` 目录,然后重启服务。

Expand Down

0 comments on commit 96865ef

Please sign in to comment.