<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 11\. Upstreams *地址*:/upstreams *說明*:Upstream 是虛擬主機抽象,對給定的多個服務節點按照配置規則進行負載均衡。Upstream 的地址信息可以直接配置到`Route`(或`Service`) 上,當 Upstream 有重復時,就需要用“引用”方式避免重復了。 ### 11.1 請求方法 | NAME | 請求URI | 請求body | 說明 | | --- | --- | --- | --- | | POST | /upstreams | {...} | 新增upstreams | | GET | /upstreams | | 查詢upstreams列表 | | GET | /upstreams/{name or id} | | 查詢單個upstream | | GET | /targets/{target host:port or id}/upstream | | 同上 | | PATCH | /upstreams/{name or id} | {...} | 更新upstream | | ~ | /targets/{target host:port or id}/upstream | {...} | 同上 | | PUT | /upstreams/{name or id} | | 新增/更新upstream | | ~ | /targets/{target host:port or id}/upstream | | 同上 | | DELETE | /upstreams/{name or id} | | 刪除upstream | | ~ | /targets/{target host:port or id}/upstream | | 同上 | | GET | /upstreams/{name or id}/health | | 獲取upstream健康狀態 | ### 11.2 body 請求參數 | 參數名 | 可選 | 默認值 | 說明 | 示例 | | --- | --- | --- | --- | --- | | name | 可選 | | 標識upsream名稱 | examples.v1.upstream | | hash\_on | 可選 | none | | | | hash\_fallback | 可選 | | One of:`none`,`consumer`,`ip`,`header`, or`cookie` | | | hash\_on\_header | 可選 | | The header name to take the value from as hash input. Only required when`hash_on`is set to`header`. | | | hash\_fallback\_header | 可選 | | The header name to take the value from as hash input. Only required when`hash_fallback`is set to`header`. | | | hash\_on\_cookie | 可選 | | The cookie name to take the value from as hash input. Only required when`hash_on`or`hash_fallback`is set to`cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response. | | | hash\_on\_cookie\_path | 可選 | / | The cookie path to set in the response headers. Only required when`hash_on`or`hash_fallback`is set to`cookie`. Defaults to`"/"`. | | | slots | 可選 | 10000 | `10`\-`65536` | | | healthchecks | 參見active和passive | | | | | tags | 可選 | | 標簽 | | healthchecks(ACTIVE) | https\_verify\_certificate | 可選 | true | | | | --- | --- | --- | --- | --- | | unhealthy.http\_statuses | 可選 | \[429, 404, 500, 501, 502, 503, 504, 505\] | 非健康的http狀態碼 | | | unhealthy.tcp\_failures | 可選 | 0 | 非健康tcp失敗次數 | | | unhealthy.timeouts | 可選 | 0 | 超時次數,超過該值就設置為unhealthy | | | unhealthy.http\_failures | 可選 | 0 | http訪問失敗次數,超過該值設置為unhealthy,為0不探測 | | | unhealthy.interval | 可選 | 0 | 為0 不探測,兩次探測非健康檢查的間隔時長 | | | http\_path | 可選 | / | 健康檢查的訪問路徑 | | | timeout | 可選 | 1 | socket超時時長 | | | healthy.http\_statuses | 可選 | \[200, 302\] | http狀態為設置值其中 個,則對成功指標進行+1 | | | healthy.interval | 可選 | 0 | 兩次健康檢查探測的間隔時長(單位為秒) | | | healthy.successes | 可選 | 0 | 健康的成功計數指標 | | | https\_sni | 可選 | | | | | concurrency | 可選 | 10 | 并發數 | | | type | 可選 | http | `tcp`,`http`or`https` | | healthchecks(passive) | unhealthy.http\_failures | 可選 | 0 | 代理流量中的HTTP失敗數(由定義健康檢查。被動。不健康.http\_status)將目標視為不健康,如被動運行狀況檢查所觀察到的 | 1 | | --- | --- | --- | --- | --- | | unhealthy.http\_statuses | 可選 | \[429, 500, 503\] | 訪問http的狀態碼為其中之一的 | \[429,500,503\] | | unhealthy.tcp\_failures | 可選 | 0 | 被動運行狀況檢查觀察到的被代理流量中認為目標不正常的TCP故障數 | 1 | | unhealthy.timeouts | 可選 | 0 | 被動運行狀況檢查所觀察到的代理流量中認為目標不正常的超時數 | 1 | | type | 可選 | http | `tcp`,`http`or`https` | http | | healthy.successes | 可選 | 0 | 成功的次數 | 0 | | healthy.http\_statuses | 可選 | \[200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308\] | http成功的狀態 | | ### 11.3 數據樣例 body請求參數 ``` { "id": "91020192-062d-416f-a275-9addeeaffaf2", "created_at": 1422386534, "name": "my-upstream", "hash_on": "none", "hash_fallback": "none", "hash_on_cookie_path": "/", "slots": 10000, "healthchecks": { "active": { "https_verify_certificate": true, "unhealthy": { "http_statuses": [429, 404, 500, 501, 502, 503, 504, 505], "tcp_failures": 0, "timeouts": 0, "http_failures": 0, "interval": 0 }, "http_path": "/", "timeout": 1, "healthy": { "http_statuses": [200, 302], "interval": 0, "successes": 0 }, "https_sni": "example.com", "concurrency": 10, "type": "http" }, "passive": { "unhealthy": { "http_failures": 0, "http_statuses": [429, 500, 503], "tcp_failures": 0, "timeouts": 0 }, "type": "http", "healthy": { "successes": 0, "http_statuses": [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308] } } }, "tags": ["user-level", "low-priority"] } ``` upstream列表 ``` { "data": [{ "id": "a2e013e8-7623-4494-a347-6d29108ff68b", "created_at": 1422386534, "name": "my-upstream", "hash_on": "none", "hash_fallback": "none", "hash_on_cookie_path": "/", "slots": 10000, "healthchecks": { "active": { "https_verify_certificate": true, "unhealthy": { "http_statuses": [429, 404, 500, 501, 502, 503, 504, 505], "tcp_failures": 0, "timeouts": 0, "http_failures": 0, "interval": 0 }, "http_path": "/", "timeout": 1, "healthy": { "http_statuses": [200, 302], "interval": 0, "successes": 0 }, "https_sni": "example.com", "concurrency": 10, "type": "http" }, "passive": { "unhealthy": { "http_failures": 0, "http_statuses": [429, 500, 503], "tcp_failures": 0, "timeouts": 0 }, "type": "http", "healthy": { "successes": 0, "http_statuses": [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308] } } }, "tags": ["user-level", "low-priority"] }, { "id": "147f5ef0-1ed6-4711-b77f-489262f8bff7", "created_at": 1422386534, "name": "my-upstream", "hash_on": "none", "hash_fallback": "none", "hash_on_cookie_path": "/", "slots": 10000, "healthchecks": { "active": { "https_verify_certificate": true, "unhealthy": { "http_statuses": [429, 404, 500, 501, 502, 503, 504, 505], "tcp_failures": 0, "timeouts": 0, "http_failures": 0, "interval": 0 }, "http_path": "/", "timeout": 1, "healthy": { "http_statuses": [200, 302], "interval": 0, "successes": 0 }, "https_sni": "example.com", "concurrency": 10, "type": "http" }, "passive": { "unhealthy": { "http_failures": 0, "http_statuses": [429, 500, 503], "tcp_failures": 0, "timeouts": 0 }, "type": "http", "healthy": { "successes": 0, "http_statuses": [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308] } } }, "tags": ["admin", "high-priority", "critical"] }], "next": "http://localhost:8001/upstreams?offset=6378122c-a0a1-438d-a5c6-efabae9fb969" } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看