From f29b0f799fffb3385221fb721c1cb901addba3d3 Mon Sep 17 00:00:00 2001 From: soulbird Date: Mon, 29 Aug 2022 16:08:01 +0800 Subject: [PATCH 1/7] docs(FAQ): add APISIX health probe solution --- docs/en/latest/FAQ.md | 30 ++++++++++++++++++++++++++++++ docs/zh/latest/FAQ.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md index c694869b530e..3742e0e13dec 100644 --- a/docs/en/latest/FAQ.md +++ b/docs/en/latest/FAQ.md @@ -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? + +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/status \ +-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: diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index ce97c059a4de..639b7333bf12 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -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 相关问题的提问。 From af659422da38f10a5d69e83c0b57decc52fc26f9 Mon Sep 17 00:00:00 2001 From: soulbird Date: Mon, 29 Aug 2022 16:14:04 +0800 Subject: [PATCH 2/7] fix route url --- docs/en/latest/FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md index 3742e0e13dec..851758f18f8d 100644 --- a/docs/en/latest/FAQ.md +++ b/docs/en/latest/FAQ.md @@ -599,7 +599,7 @@ The differences between the two are described in the table below: 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/status \ +curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ -H 'X-API-KEY: YOUR-TOKEN' -X PUT -d ' { "plugins": { From 06e2120fb346032fc2a78a00724055336de7de52 Mon Sep 17 00:00:00 2001 From: soulbird Date: Mon, 29 Aug 2022 16:51:23 +0800 Subject: [PATCH 3/7] fix lint --- docs/zh/latest/FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index 639b7333bf12..356d147f806a 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -595,7 +595,7 @@ apisix: | 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 | | 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 | -## 部署了Apache APISIX之后,如何检测APISIX 数据平面的存活情况(如何探活)? +## 部署了 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 地址,可以自行修改): From 52343305b04c35801aaa701c75422639d60ed607 Mon Sep 17 00:00:00 2001 From: soulbird Date: Mon, 29 Aug 2022 17:30:10 +0800 Subject: [PATCH 4/7] fix lint --- docs/zh/latest/FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index 356d147f806a..4744d5a758fb 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -595,7 +595,7 @@ apisix: | 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 | | 对绑定到 Plugin 的配置实例的所有实体生效。 | 对绑定到 `plugin-config` 的路由生效。 | -## 部署了 Apache APISIX之后,如何检测APISIX 数据平面的存活情况(如何探活)? +## 部署了 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 地址,可以自行修改): From e8e3f9c5521b8e44ef0f1da1df345ca715e6311a Mon Sep 17 00:00:00 2001 From: soulbird Date: Tue, 30 Aug 2022 09:17:43 +0800 Subject: [PATCH 5/7] fix code block tag --- docs/en/latest/FAQ.md | 2 +- docs/zh/latest/FAQ.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md index 851758f18f8d..4c203d868b03 100644 --- a/docs/en/latest/FAQ.md +++ b/docs/en/latest/FAQ.md @@ -598,7 +598,7 @@ The differences between the two are described in the table below: 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 +```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ -H 'X-API-KEY: YOUR-TOKEN' -X PUT -d ' { diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index 4744d5a758fb..bbdb70a333db 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -599,7 +599,7 @@ 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 +```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ -H 'X-API-KEY: YOUR-TOKEN' -X PUT -d ' { From c063fbf2ecc107a8ae1f7da19a33ed4ba47a9cd3 Mon Sep 17 00:00:00 2001 From: soulbird Date: Tue, 30 Aug 2022 09:40:45 +0800 Subject: [PATCH 6/7] fix ip to IP --- docs/en/latest/FAQ.md | 2 +- docs/zh/latest/FAQ.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md index 4c203d868b03..aa06e65a5b90 100644 --- a/docs/en/latest/FAQ.md +++ b/docs/en/latest/FAQ.md @@ -596,7 +596,7 @@ The differences between the two are described in the table below: ## After deploying Apache APISIX, how to detect the survival of the APISIX data plane? -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): +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 token; 127.0.0.1 is the IP address of the control plane, which can be modified by yourself): ```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index bbdb70a333db..0dcbba5937e6 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -597,7 +597,7 @@ apisix: ## 部署了 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 地址,可以自行修改): +可以创建一个名为 `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 地址,可以自行修改): ```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ From f668ef26620a3be1839ccae575c1e54da4915a29 Mon Sep 17 00:00:00 2001 From: soulbird Date: Tue, 30 Aug 2022 11:33:25 +0800 Subject: [PATCH 7/7] use Website's URL --- docs/en/latest/FAQ.md | 4 ++-- docs/zh/latest/FAQ.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md index aa06e65a5b90..8b7e48deac88 100644 --- a/docs/en/latest/FAQ.md +++ b/docs/en/latest/FAQ.md @@ -596,7 +596,7 @@ The differences between the two are described in the table below: ## After deploying Apache APISIX, how to detect the survival of the APISIX data plane? -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 token; 127.0.0.1 is the IP address of the control plane, which can be modified by yourself): +You can create a route named `health-info` and enable the [fault-injection](https://apisix.apache.org/docs/apisix/plugins/fault-injection/) plugin (where YOUR-TOKEN is the user's token; 127.0.0.1 is the IP address of the control plane, which can be modified by yourself): ```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ @@ -614,7 +614,7 @@ curl http://127.0.0.1:9180/apisix/admin/routes/health-info \ }' ```` -Ways of identifying: +Verification: Access the `/status` of the Apache APISIX data plane to detect APISIX. If the response code is 200, it means APISIX is alive. diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md index 0dcbba5937e6..9f6f57459e7f 100644 --- a/docs/zh/latest/FAQ.md +++ b/docs/zh/latest/FAQ.md @@ -597,7 +597,7 @@ apisix: ## 部署了 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 地址,可以自行修改): +可以创建一个名为 `health-info` 的路由,并开启 [fault-injection](https://apisix.apache.org/zh/docs/apisix/plugins/fault-injection/) 插件(其中 YOUR-TOKEN 是用户自己的 token;127.0.0.1 是控制平面的 IP 地址,可以自行修改): ```shell curl http://127.0.0.1:9180/apisix/admin/routes/health-info \