<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Health Check > 原文:[https://docs.gitlab.com/ee/user/admin_area/monitoring/health_check.html](https://docs.gitlab.com/ee/user/admin_area/monitoring/health_check.html) * [IP whitelist](#ip-whitelist) * [Using the endpoints locally](#using-the-endpoints-locally) * [Health](#health) * [Readiness](#readiness) * [Liveness](#liveness) * [Access token (Deprecated)](#access-token-deprecated) # Health Check[](#health-check-core-only "Permalink") 版本歷史 * 在 GitLab 9.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10416)了活動性和就緒性探針. * `health_check`端點是在 GitLab 8.8 中[引入的](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/3888) ,在 GitLab 9.1 中已棄用. * 在 GitLab 9.4 中不贊成使用[訪問令牌](#access-token-deprecated) ,而推薦使用[IP 白名單](#ip-whitelist) . manbetx 客戶端打不開提供活躍度和準備情況探針,以指示服務的健康狀況和對所需服務的可達性. 這些探針報告數據庫連接,Redis 連接和對文件系統的訪問狀態. [可以將](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)這些端點[提供給 Kubernetes 之類的調度程序](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)以保持流量,直到系統準備就緒或根據需要重新啟動容器. ## IP whitelist[](#ip-whitelist "Permalink") 要訪問監視資源,需要將發出請求的客戶端 IP 包含在白名單中. 有關詳細信息,請參閱[如何將 IP 添加到監視端點的白名單](../../../administration/monitoring/ip_whitelist.html) . ## Using the endpoints locally[](#using-the-endpoints-locally "Permalink") 使用默認白名單設置,可以使用以下 URL 從本地主機訪問探針: ``` GET http://localhost/-/health ``` ``` GET http://localhost/-/readiness ``` ``` GET http://localhost/-/liveness ``` ## Health[](#health "Permalink") 檢查應用服務器是否正在運行. 它不會驗證數據庫或其他服務是否正在運行. 該端點繞過了 Rails Controller,并在請求處理生命周期的早期就作為附加的中間件`BasicHealthCheck`實現. ``` GET /-/health ``` 請求示例: ``` curl 'https://gitlab.example.com/-/health' ``` 響應示例: ``` GitLab OK ``` ## Readiness[](#readiness "Permalink") 就緒探針會檢查 GitLab 實例是否準備好通過 Rails Controller 接受流量. 默認情況下,該檢查僅驗證實例檢查. 如果指定了`all=1`參數,則檢查還將驗證相關服務(數據庫,Redis,Gitaly 等)并為每個服務提供狀態. ``` GET /-/readiness GET /-/readiness?all=1 ``` 請求示例: ``` curl 'https://gitlab.example.com/-/readiness' ``` Example response: ``` { "master_check":[{ "status":"failed", "message": "unexpected Master check result: false" }], ... } ``` 失敗時,端點將返回`503` HTTP 狀態代碼. 如果通過`token`身份驗證,則此檢查確實會命中數據庫,并且會重做 Redis. 此檢查不受機架攻擊. ## Liveness[](#liveness "Permalink") **警告:**在 GitLab [12.4](https://about.gitlab.com/upcoming-releases/)中,"活動性"檢查的響應主體已更改為與以下示例匹配. 檢查應用服務器是否正在運行. 該探針用于了解 Rails 控制器是否不會由于多線程而死鎖. ``` GET /-/liveness ``` 請求示例: ``` curl 'https://gitlab.example.com/-/liveness' ``` 響應示例: 成功后,端點將返回`200` HTTP 狀態代碼和如下響應. ``` { "status": "ok" } ``` 失敗時,端點將返回`503` HTTP 狀態代碼. 此檢查不受機架攻擊. ## Access token (Deprecated)[](#access-token-deprecated "Permalink") **注意:**在 GitLab 9.4 中不贊成使用訪問令牌,而推薦使用[IP 白名單](#ip-whitelist) . 訪問探針端點時需要提供訪問令牌. 當前接受的令牌可以在您的 GitLab 實例的**管理區域>監視>運行狀況檢查** ( `admin/health_check` )頁面下找到. [![access token](https://img.kancloud.cn/dc/57/dc577bb019d2cabb98ad703938c3f589_764x152.png)](img/health_check_token.png) 可以將訪問令牌作為 URL 參數傳遞: ``` https://gitlab.example.com/-/readiness?token=ACCESS_TOKEN ``` **注意:**如果無法訪問數據庫或 Redis 服務,則不能保證探針端點響應正確. 您應該從已棄用的訪問令牌切換到[IP 白名單](#ip-whitelist) ,以避免出現這種情況.
                  <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>

                              哎呀哎呀视频在线观看