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

docs(FAQ): add APISIX health probe solution #7812

Merged
merged 7 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
30 changes: 30 additions & 0 deletions docs/en/latest/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,36 @@ The differences between the two are described in the table below:
| Used when there are property changes that needs to be propagated across all configuration instances of a Plugin. | Used when you need to reuse a common set of configuration instances so that it can be extracted to a `plugin-config` and bound to different Routes. |
| Takes effect on all the entities bound to the configuration instances of the Plugin. | Takes effect on Routes bound to the `plugin-config`. |

## After deploying Apache APISIX, how to detect the survival of the APISIX data plane?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 I just did a quick search, but I'm still unsure how to express the meaning of whether API Gateway is running or in trouble. Any ideas? @moonming


You can create a route named `health-info` and enable the [fault-injection](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/fault-injection.md) plugin (where YOUR-TOKEN is the user's own token; 127.0.0.1 is the ip address of the control plane, which can be modified by yourself):

```bash
curl http://127.0.0.1:9180/apisix/admin/routes/health-info \
-H 'X-API-KEY: YOUR-TOKEN' -X PUT -d '
{
"plugins": {
"fault-injection": {
"abort": {
"http_status": 200,
"body": "fine"
}
}
},
"uri": "/status"
}'
````

Ways of identifying:

Access the `/status` of the Apache APISIX data plane to detect APISIX. If the response code is 200, it means APISIX is alive.

:::note

This method only detects whether the APISIX data plane is alive or not. It does not mean that the routing and other functions of APISIX are normal. These require more routing-level detection.

:::

## Where can I find more answers?

You can find more answers on:
Expand Down
30 changes: 30 additions & 0 deletions docs/zh/latest/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,36 @@ apisix:
| 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 |
| 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 |

## 部署了 Apache APISIX 之后,如何检测 APISIX 数据平面的存活情况(如何探活)?

可以创建一个名为 `health-info` 的路由,并开启 [fault-injection](https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/fault-injection.md) 插件(其中 YOUR-TOKEN 是用户自己的 token;127.0.0.1 是控制平面的 ip 地址,可以自行修改):

```bash
curl http://127.0.0.1:9180/apisix/admin/routes/health-info \
-H 'X-API-KEY: YOUR-TOKEN' -X PUT -d '
{
"plugins": {
"fault-injection": {
"abort": {
"http_status": 200,
"body": "fine"
}
}
},
"uri": "/status"
}'
```

验证方式:

访问 Apache APISIX 数据平面的 `/status` 来探测 APISIX,如果 response code 是 200 就代表 APISIX 存活。

:::note

这个方式只是探测 APISIX 数据平面是否存活,并不代表 APISIX 的路由和其他功能是正常的,这些需要更多路由级别的探测。

:::

## 如果在使用 APISIX 过程中遇到问题,我可以在哪里寻求更多帮助?

- [Apache APISIX Slack Channel](/docs/general/join/#加入-slack-频道):加入后请选择 channel-apisix 频道,即可通过此频道进行 APISIX 相关问题的提问。
Expand Down