1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        Nginx-Stream-UpSync-Module彈性擴縮容方案

        聯(lián)合創(chuàng)作 · 2023-10-01 15:51

        Nginx-Stream-UpSync-Module 是基于nginx四層TCP協(xié)議的彈性擴縮容方案,實現(xiàn)性能無損的擴容縮容:

        當前模塊支持etcd 和 consul,相關配置如下:

        nginx-etcd:

        stream {
            upstream test {
                # fake server otherwise ngx_stream_upstream will report error when startup
                server 127.0.0.1:11111;
        
                # all backend server will pull from etcd when startup and will delete fake server
                upsync 127.0.0.1:8500/v2/keys/upstreams/test upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off;
                upsync_dump_path /usr/local/nginx/conf/servers/servers_test.conf;
            }
        
            upstream bar {
                server 127.0.0.1:8090 weight=1, fail_timeout=10, max_fails=3;
            }
        
            server {
                listen 12345;
        
                proxy_connect_timeout 1s;
                proxy_timeout 3s;
                proxy_pass test;
            }
        
            server {
                listen 2345;
        
                upstream_show
            }
        
            server {
                listen 127.0.0.1:9091;
        
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass bar;
            }
        }

        nginx-consul:

        stream {
            upstream test {
                # fake server otherwise ngx_stream_upstream will report error when startup
                server 127.0.0.1:11111;
        
                # all backend server will pull from consul when startup and will delete fake server
                upsync 127.0.0.1:8500/v1/kv/upstreams/test upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
                upsync_dump_path /usr/local/nginx/conf/servers/servers_test.conf;
            }
        
            upstream bar {
                server 127.0.0.1:8090 weight=1, fail_timeout=10, max_fails=3;
            }
        
            server {
                listen 12345;
        
                proxy_connect_timeout 1s;
                proxy_timeout 3s;
                proxy_pass test;
            }
        
            server {
                listen 2345;
        
                upstream_show
            }
        
            server {
                listen 127.0.0.1:9091;
        
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass bar;
            }
        }

        相關設計文檔可參考:https://github.com/weibocom/nginx-upsync-module/tree/master/doc;

        設計原理一致。

        瀏覽 15
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            综合网中文字幕 | 国产AAAAAAAAA片BBB | 艳妇臀荡乳欲伦岳txt下载 | 精品欧美色视频网站在线观看 | 亚洲黄色在线 | 五月婷久操 | 国产操大逼视频 | 久久综合国产视频 | 午夜干干| 亚洲一区久久久 |