Google App Engine弹性状态检查中的Docker网址错误 [英] Docker in Google App Engine Flexible health check has wrong URL

查看:71
本文介绍了Google App Engine弹性状态检查中的Docker网址错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务使用如下网址:

My service uses a url like this:

<google_url>/v1/lookup_stuff

<google_url>/v1/是服务中所有内容的基本URL,因此当运行状况检查ping <google_url>时,它得到404.我需要更新为ping <google_url>/v1/

<google_url>/v1/ is the base url for everything in the service, so when the health check pings <google_url> it gets a 404. I need to update to ping <google_url>/v1/

(可能有用的信息,该服务在Docker中,当我手动转到正确的URL时可以访问该服务)

(Possibly useful information, the service is in Docker, and is accessible when I manually go to the right URL)

如何将gcloud的运行状况服务指向正确的服务网址?

How do I point gcloud's health service at the correct URL for my service?

为清楚起见:

  • Google网址:service-something.appspot.com
  • 所有服务网址均在以下位置:service-something.appspot.com/v1
  • Google url: service-something.appspot.com
  • All urls for service are under: service-something.appspot.com/v1

我需要将健康检查器指向:

I need to point health checker to:

  • service-something.appspot.com/v1/_ah/health

代替

  • service-something.appspot.com/_ah/health

推荐答案

更新:

灵活环境现在支持

The flexible environment now supports the Updated health checks, consisting of separately configurable liveness checks and/or readiness checks, both with a configurable path capability.

请注意,这些更新的运行状况检查不兼容,并且不能与旧式运行状况检查并存:

Note that these updated health checks are not compatible and cannot coexit with the legacy health checks:

您必须为每个项目分别启用更新的运行状况检查. 默认情况下,旧式运行状况检查已启用.不能同时使用 同一项目中的健康检查类型.

You must enable updated health checks for each project individually. By default, legacy health checks are enabled. You cannot use both types of health checks in the same project.

原始答案,仅适用于旧版健康检查:

该路径当前不可配置.来自运行状况检查:

The path is not currently configurable. From Health checking:

您无需执行任何特殊操作即可实施运行状况检查. 如果您的应用程序不处理运行状况检查,则HTTP 404响应为 解释为成功的答复.

You do not have to do anything special to implement health checking. If your app does not handle health checks, a HTTP 404 response is interpretated as a successful reply.

您可以编写自己的自定义运行状况检查代码.它应该回复 /_ah/health请求带有HTTP状态代码200.响应 必须包含消息正文,但是,正文的值将被忽略 (可以为空).

You can write your own custom health-checking code. It should reply to /_ah/health requests with a HTTP status code 200. The response must include a message body, however, the value of the body is ignored (it can be empty).

因此,您可以这样保留它-您的应用始终被认为是健康的.或者,您可以在/_ah/health教您的应用正确回答健康检查请求.

So you can leave it like that - your app being always considered healthy. Or you can teach your app to correctly answer to the health check requests at /_ah/health.

这篇关于Google App Engine弹性状态检查中的Docker网址错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆