非商业版本的 nginx 是否支持配置 health_check

2018-05-22 19:26:58 +08:00
 ysicing
nginx/1.13.12

# kube.conf
upstream kubeapi {
        least_conn;
        zone kube_api_zone 64k;
        server 192.168.8.228:6443 max_fails=1 fail_timeout=30s;
        server 10.10.10.227:6443 max_fails=1 fail_timeout=30s;
        server 192.168.8.229:6443 max_fails=1 fail_timeout=30s;
}
server {
        listen        127.0.0.1:6443;
        proxy_pass    kubeapi;
        proxy_timeout 10m;
        proxy_connect_timeout 1s;
        health_check;
}

如果配置了,会提示提示unknown directive "health_check" in /etc/nginx/conf/sites_stream/kube.conf:13,是我的姿势不对么,基于 nginx 镜像,微调了 log 部分,还是是ngx_stream_upstream_hc_module在编译时就有配置上么?

附上:

#docker-compose.yaml
version: '2.1'
services:
  tcp-proxy:
    image: spanda/proxy:tcp
    container_name: tcp-proxy
    volumes:
      - /tmp/nginx/sites_stream:/etc/nginx/conf/sites_stream
      - /tmp/nginx/sites_http:/etc/nginx/conf/sites_http
      - /tmp/nginx/ssl:/etc/nginx/conf/ssl
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "3"
    network_mode: "host"
2982 次点击
所在节点    NGINX
3 条回复
digimoon
2018-05-22 19:55:09 +08:00
不支持
yghack
2018-05-22 20:06:42 +08:00
试试 nginx_upstream_check_module 吧
ysicing
2018-05-22 20:53:02 +08:00
@yghack 回去我看看☺️

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/456922

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX