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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Working with the bundled Consul service > 原文:[https://docs.gitlab.com/ee/administration/high_availability/consul.html](https://docs.gitlab.com/ee/administration/high_availability/consul.html) * [Prerequisites](#prerequisites) * [Configuring the Consul nodes](#configuring-the-consul-nodes) * [Consul checkpoint](#consul-checkpoint) * [Operations](#operations) * [Checking cluster membership](#checking-cluster-membership) * [Restarting the server cluster](#restarting-the-server-cluster) * [Upgrades for bundled Consul](#upgrades-for-bundled-consul) * [Troubleshooting](#troubleshooting) * [Consul server agents unable to communicate](#consul-server-agents-unable-to-communicate) * [Consul agents do not start - Multiple private IPs](#consul-agents-do-not-start---multiple-private-ips) * [Outage recovery](#outage-recovery) * [Recreate from scratch](#recreate-from-scratch) * [Recover a failed cluster](#recover-a-failed-cluster) # Working with the bundled Consul service[](#working-with-the-bundled-consul-service-premium-only "Permalink") 作為其高可用性堆棧的一部分,GitLab Premium 包含可通過`/etc/gitlab/gitlab.rb`管理的捆綁版本的[Consul](https://www.consul.io/) . Consul 是服務網絡解決方案. 對于[GitLab Architecture](../../development/architecture.html) ,支持 Consul 利用來配置: 1. [Monitoring in Scaled and Highly Available environments](monitoring_node.html) 2. [PostgreSQL High Availability with Omnibus](../postgresql/replication_and_failover.html) Consul 群集由多個服務器代理以及在其他需要與 Consul 群集通信的節點上運行的客戶端代理組成. ## Prerequisites[](#prerequisites "Permalink") 首先,請確保**在每個節點上** [下載/安裝](https://about.gitlab.com/install/) Omnibus GitLab. 選擇一種安裝方法,然后確保完成以下步驟: 1. 安裝和配置必要的依賴項. 2. 添加 GitLab 軟件包存儲庫并安裝軟件包. 安裝 GitLab 軟件包時,請勿提供`EXTERNAL_URL`值. ## Configuring the Consul nodes[](#configuring-the-consul-nodes "Permalink") 在每個 Consul 節點上執行以下操作: 1. 在執行下一步之前,請確保為[`CONSUL_SERVER_NODES`](../postgresql/replication_and_failover.html#consul-information)收集[`CONSUL_SERVER_NODES`](../postgresql/replication_and_failover.html#consul-information) ,它們是 Consul 服務器節點的 IP 地址或 DNS 記錄. 2. 編輯`/etc/gitlab/gitlab.rb`替換`/etc/gitlab/gitlab.rb` `# START user configuration`部分中記錄的值: ``` # Disable all components except Consul roles ['consul_role'] # START user configuration # Replace placeholders: # # Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z # with the addresses gathered for CONSUL_SERVER_NODES consul['configuration'] = { server: true, retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z) } # Disable auto migrations gitlab_rails['auto_migrate'] = false # # END user configuration ``` > `consul_role`在 GitLab 10.3 中引入 3. [重新配置 GitLab,](../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. ### Consul checkpoint[](#consul-checkpoint "Permalink") 在繼續之前,請確保 Consul 配置正確. 運行以下命令以驗證所有服務器節點都在通信: ``` /opt/gitlab/embedded/bin/consul members ``` 輸出應類似于: ``` Node Address Status Type Build Protocol DC CONSUL_NODE_ONE XXX.XXX.XXX.YYY:8301 alive server 0.9.2 2 gitlab_consul CONSUL_NODE_TWO XXX.XXX.XXX.YYY:8301 alive server 0.9.2 2 gitlab_consul CONSUL_NODE_THREE XXX.XXX.XXX.YYY:8301 alive server 0.9.2 2 gitlab_consul ``` 如果任何一個節點都不`alive`或三個節點中的任何一個都不`alive` ,請在繼續操作之前檢查" [疑難解答"部分](#troubleshooting) . ## Operations[](#operations "Permalink") ### Checking cluster membership[](#checking-cluster-membership "Permalink") 要查看哪些節點是集群的一部分,請在集群中的任何成員上運行以下命令 ``` $ /opt/gitlab/embedded/bin/consul members Node Address Status Type Build Protocol DC consul-b XX.XX.X.Y:8301 alive server 0.9.0 2 gitlab_consul consul-c XX.XX.X.Y:8301 alive server 0.9.0 2 gitlab_consul consul-c XX.XX.X.Y:8301 alive server 0.9.0 2 gitlab_consul db-a XX.XX.X.Y:8301 alive client 0.9.0 2 gitlab_consul db-b XX.XX.X.Y:8301 alive client 0.9.0 2 gitlab_consul ``` Ideally all nodes will have a `Status` of `alive`. ### Restarting the server cluster[](#restarting-the-server-cluster "Permalink") **注意:**本部分僅適用于服務器代理. 在需要時重新啟動客戶端代理是安全的. 如果有必要重新啟動服務器群集,則以受控方式進行此操作很重要,以保持仲裁. 如果仲裁丟失,則需要遵循 Consul [中斷恢復](#outage-recovery)過程來恢復群集. 為了安全起見,建議您一次僅重新啟動一個服務器代理,以確保群集保持完整. 對于較大的群集,可以一次重新啟動多個代理. 請參閱[領事共識文檔,](https://www.consul.io/docs/internals/consensus.html#deployment-table)以了解可以容忍多少次失敗. 這是它可以承受的同時重啟的次數. ## Upgrades for bundled Consul[](#upgrades-for-bundled-consul "Permalink") 運行 GitLab 捆綁的 Consul 的節點應為: * 升級 Omnibus GitLab 軟件包之前,健康集群的成員. * 一次升級一個節點. **注意:**從任何 Consul 節點運行`curl http://127.0.0.1:8500/v1/health/state/critical` ,將識別群集中的現有運行狀況問題. 如果群集運行狀況良好,該命令將返回一個空數組. 領事群集使用筏協議進行通信. 如果當前領導者下線,則需要進行領導者選舉. 必須存在一個領導者節點,以促進整個集群之間的同步. 如果同時有太多節點脫機,則由于[共識破裂](https://www.consul.io/docs/internals/consensus.html) ,群集將失去仲裁且不會選舉領導者. 如果群集在升級后無法恢復,請參考[故障排除部分](#troubleshooting) . [中斷恢復](#outage-recovery)可能特別有意義. **注意:** GitLab 僅使用 Consul 來存儲易于重新生成的瞬態數據. 如果捆綁包的 Consul 除了 GitLab 本身以外沒有被其他進程使用,那么[從頭開始重建集群](#recreate-from-scratch)就可以了. ## Troubleshooting[](#troubleshooting "Permalink") ### Consul server agents unable to communicate[](#consul-server-agents-unable-to-communicate "Permalink") 默認情況下,服務器代理將嘗試[綁定](https://www.consul.io/docs/agent/options.html#_bind)到" 0.0.0.0",但是它們將通告節點上的第一個私有 IP 地址,以供其他代理與其通信. 如果其他節點無法與此地址上的節點通信,則群集將處于故障狀態. 如果遇到此問題,您將在`gitlab-ctl tail consul`輸出中看到類似以下的消息: ``` 2017-09-25_19:53:39.90821 2017/09/25 19:53:39 [WARN] raft: no known peers, aborting election 2017-09-25_19:53:41.74356 2017/09/25 19:53:41 [ERR] agent: failed to sync remote state: No cluster leader ``` 要解決此問題: 1. 在每個其他節點都可以到達的節點上選擇一個地址. 2. 更新您的`/etc/gitlab/gitlab.rb` ``` consul['configuration'] = { ... bind_addr: 'IP ADDRESS' } ``` 3. Run `gitlab-ctl reconfigure` 如果仍然看到錯誤,則可能必須[刪除 Consul 數據庫并](#recreate-from-scratch)在受影響的節點上[重新初始化](#recreate-from-scratch) . ### Consul agents do not start - Multiple private IPs[](#consul-agents-do-not-start---multiple-private-ips "Permalink") 如果一個節點具有多個專用 IP,則代理會混淆要播發哪個專用地址,然后在啟動時立即退出. 如果遇到此問題,您將在`gitlab-ctl tail consul`輸出中看到類似以下的消息: ``` 2017-11-09_17:41:45.52876 ==> Starting Consul agent... 2017-11-09_17:41:45.53057 ==> Error creating agent: Failed to get advertise address: Multiple private IPs found. Please configure one. ``` 要解決此問題: 1. 在該節點上選擇一個地址,所有其他節點都可以通過該地址到達該節點. 2. 更新您的`/etc/gitlab/gitlab.rb` ``` consul['configuration'] = { ... bind_addr: 'IP ADDRESS' } ``` 3. Run `gitlab-ctl reconfigure` ### Outage recovery[](#outage-recovery "Permalink") 如果您在群集中丟失了足夠的服務器代理以破壞仲裁,則該群集將被視為失敗,并且如果沒有手動干預,它將無法運行. #### Recreate from scratch[](#recreate-from-scratch "Permalink") 默認情況下,GitLab 不會在 Consul 群集中存儲任何無法重新創建的內容. 刪除 Consul 數據庫并重新初始化 ``` gitlab-ctl stop consul rm -rf /var/opt/gitlab/consul/data gitlab-ctl start consul ``` 此后,群集應開始備份,并且服務器代理重新加入. 之后不久,客戶代理也應重新加入. #### Recover a failed cluster[](#recover-a-failed-cluster "Permalink") 如果您已利用 Consul 來存儲其他數據,并想還原發生故障的群集,請按照[Consul 指南](https://learn.hashicorp.com/consul/day-2-operations/outage)來恢復發生故障的群集.
                  <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>

                              哎呀哎呀视频在线观看