Skip to content

Commit

Permalink
doc: etcd grpc gateway faq (#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
tokers authored Dec 3, 2020
1 parent a52b5e9 commit 9e3c34a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,29 @@ If you want to specify a meaningful id to bind APISIX instance to your internal
apisix:
id: "your-meaningful-id"
```

## Why there are a lot of "failed to fetch data from etcd, failed to read etcd dir, etcd key: xxxxxx" errors in error.log?

First please make sure the network between APISIX and etcd cluster is not partitioned.

If the network is healthy, please check whether your etcd cluster enables the [gRPC gateway](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/). However, The default case for this feature is different when use command line options or configuration file to start etcd server.

1. When command line options is in use, this feature is enabled by default, the related option is `--enable-grpc-gateway`.

```sh
etcd --enable-grpc-gateway --data-dir=/path/to/data
```

Note this option is not shown in the output of `etcd --help`.

2. When configuration file is used, this feature is disabled by default, please enable `enable-grpc-gateway` explicitly.

```json
# etcd.json
{
"enable-grpc-gateway": true,
"data-dir": "/path/to/data"
}
```

Indeed this distinction was eliminated by etcd in their master branch, but not backport to announced versions, so be care when deploy your etcd cluster.
26 changes: 26 additions & 0 deletions FAQ_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,29 @@ APISIX 主要使用 [etcd.watchdir](https://github.com/api7/lua-resty-etcd/blob/
apisix:
id: "your-meaningful-id"
```

## 为什么 `error.log` 中会有许多诸如 "failed to fetch data from etcd, failed to read etcd dir, etcd key: xxxxxx" 的错误?

首先请确保 APISIX 和 etcd 之间不存在网络分区的情况。

如果网络的确是健康的,请检查你的 etcd 集群是否启用了 [gRPC gateway](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/) 特性。然而,当你使用命令行参数或配置文件启动 etcd 时,此特性的默认启用情况又是不同的。

1. 当使用命令行参数启动 etcd,该特性默认被启用,相关选项是 `enable-grpc-gateway`

```sh
etcd --enable-grpc-gateway --data-dir=/path/to/data
```

注意该选项并没有展示在 `etcd --help` 的输出中。

2. 使用配置文件时,该特性默认被关闭,请明确启用 `enable-grpc-gateway` 配置项。

```json
# etcd.json
{
"enable-grpc-gateway": true,
"data-dir": "/path/to/data"
}
```

事实上这种差别已经在 etcd 的 master 分支中消除,但并没有向后移植到已经发布的版本中,所以在部署 etcd 集群时,依然需要小心。

0 comments on commit 9e3c34a

Please sign in to comment.