【问题标题】:Force unhealthy instance for rolling code updates?强制不健康的实例进行滚动代码更新?
【发布时间】:2014-06-17 23:40:26
【问题描述】:

我正在研究 Google Compute 的负载平衡,需要找出一种方法来有效地进行代码滚动。我尝试让我们的应用程序以500 状态代码响应,但池仍将实例报告为“健康”。下面是配置:

HTTP 健康检查
如果我们的 CPU/内存使用率不高于阈值,request-path 将返回“UP”。我尝试让这个路径返回一个500 HTTP 状态代码,它只是将“500”输出到具有正确状态代码标题的页面。

+-------------------+-------------+------+------+------------------+
| name              | description | host | port | request-path     |
+-------------------+-------------+------+------+------------------+
| lb-usc1-app-check |             |      | 8888 | /monitoring/si4g |
+-------------------+-------------+------+------+------------------+

目标池(包含 6 个实例)

+------------------+-------------+-------------+
| name             | description | region      |
+------------------+-------------+-------------+
| lb-usc1-app-pool |             | us-central1 |
+------------------+-------------+-------------+

转发规则

+-----------------+-------------+-------------+---------------+----------+------------+------------------------------------------+
| name            | description | region      | ip            | protocol | port-range | target                                   |
+-----------------+-------------+-------------+---------------+----------+------------+------------------------------------------+
| lb-usc1-app-443 |             | us-central1 | 23.236.56.210 | TCP      | 443-443    | us-central1/targetPools/lb-usc1-app-pool |
+-----------------+-------------+-------------+---------------+----------+------------+------------------------------------------+
| lb-usc1-app-80  |             | us-central1 | 23.236.56.210 | TCP      | 80-80      | us-central1/targetPools/lb-usc1-app-pool |
+-----------------+-------------+-------------+---------------+----------+------------+------------------------------------------+

更多详情
但是,如果我运行service nginx stop,该实例似乎将报告为关闭。但这显然不是正确的答案,因为我需要将当前部署的实例报告为不健康,等待所有连接完成,然后部署我们的代码。

另外,如果重要的话,我在池中的“会话关联性”设置为“无”。

那么,简而言之,强制 GE 负载均衡器将实例视为“不健康”的最佳方法是什么?

【问题讨论】:

    标签: load-balancing google-compute-engine


    【解决方案1】:

    看来只需将状态码设置为 503 即可开始工作。

    【讨论】:

      猜你喜欢
      • 2019-04-22
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      • 2020-12-19
      • 2023-03-19
      • 2013-09-25
      • 2016-10-28
      • 2019-04-27
      相关资源
      最近更新 更多