<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

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

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

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

          當前模塊支持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
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

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

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  无码欧美| 无码一区二区免费 | 黑人大屌操B | 俺去啦新网 | 男人的天堂在线视频 |