【发布时间】:2022-02-07 16:40:01
【问题描述】:
我的 .NET Core Elastic beanstalk 应用程序很健康,但是当我检查日志时,我看到以下内容:
10.3.12.142 - - [06/Feb/2022:17:54:53 +0000] "GET / HTTP/1.1" 404 0 "-" "ELB-HealthChecker/2.0" "10.3.2.20"
10.3.11.145 - - [06/Feb/2022:17:54:57 +0000] "GET / HTTP/1.1" 404 0 "-" "ELB-HealthChecker/2.0" "10.3.1.114"
10.3.11.145 - - [06/Feb/2022:17:55:07 +0000] "GET /_system/health HTTP/1.1" 200 232 "-" "ELB-HealthChecker/2.0" "-"
10.3.12.142 - - [06/Feb/2022:17:55:07 +0000] "GET /_system/health HTTP/1.1" 200 232 "-" "ELB-HealthChecker/2.0" "-"
10.3.11.145 - - [06/Feb/2022:17:55:07 +0000] "GET / HTTP/1.1" 404 0 "-" "ELB-HealthChecker/2.0" "10.3.1.114"
10.3.11.145 - - [06/Feb/2022:17:55:22 +0000] "GET /_system/health HTTP/1.1" 200 237 "-" "ELB-HealthChecker/2.0" "-"
10.3.12.142 - - [06/Feb/2022:17:55:22 +0000] "GET /_system/health HTTP/1.1" 200 237 "-" "ELB-HealthChecker/2.0" "-"
/_system/health 是真正的健康端点,但我不明白为什么 ELB 会点击/ 而不仅仅是/_system/health,这当然会导致应用程序预期的 404。
我有以下用于健康检查的 terraform 配置,但我不使用 .ebextensions
setting {
namespace = "aws:elasticbeanstalk:environment:process:default"
name = "HealthCheckPath"
value = "/_system/health"
}
setting {
namespace = "aws:elasticbeanstalk:application"
name = "Application Healthcheck URL"
value = "/_system/health"
}
编辑 1
在我将运行状况检查路径更改为/health(感谢@Marcin,我注意到ELB-HealthChecker 仍在点击/
10.3.11.145 - - [07/Feb/2022:08:35:08 +0000] "GET /health HTTP/1.1" 200 227 "-" "ELB-HealthChecker/2.0" "-"
10.3.12.142 - - [07/Feb/2022:08:35:08 +0000] "GET /health HTTP/1.1" 200 232 "-" "ELB-HealthChecker/2.0" "-"
10.3.12.142 - - [07/Feb/2022:08:35:13 +0000] "GET / HTTP/1.1" 404 0 "-" "ELB-HealthChecker/2.0" "10.3.2.20"
【问题讨论】:
标签: amazon-web-services .net-core amazon-elastic-beanstalk aws-application-load-balancer health-check