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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Replication (Geo) > 原文:[https://docs.gitlab.com/ee/administration/geo/replication/](https://docs.gitlab.com/ee/administration/geo/replication/) * [Overview](#overview) * [Use cases](#use-cases) * [How it works](#how-it-works) * [Architecture](#architecture) * [Requirements for running Geo](#requirements-for-running-geo) * [Firewall rules](#firewall-rules) * [LDAP](#ldap) * [Geo Tracking Database](#geo-tracking-database) * [Geo Log Cursor](#geo-log-cursor) * [Setup instructions](#setup-instructions) * [Using Omnibus GitLab](#using-omnibus-gitlab) * [Post-installation documentation](#post-installation-documentation) * [Configuring Geo](#configuring-geo) * [Updating Geo](#updating-geo) * [Pausing and resuming replication](#pausing-and-resuming-replication) * [Configuring Geo for multiple nodes](#configuring-geo-for-multiple-nodes) * [Configuring Geo with Object Storage](#configuring-geo-with-object-storage) * [Disaster Recovery](#disaster-recovery) * [Replicating the Container Registry](#replicating-the-container-registry) * [Security Review](#security-review) * [Tuning Geo](#tuning-geo) * [Set up a location-aware Git URL](#set-up-a-location-aware-git-url) * [Remove Geo node](#remove-geo-node) * [Disable Geo](#disable-geo) * [Current limitations](#current-limitations) * [Limitations on replication/verification](#limitations-on-replicationverification) * [Frequently Asked Questions](#frequently-asked-questions) * [Log files](#log-files) * [Troubleshooting](#troubleshooting) # Replication (Geo)[](#replication-geo-premium-only "Permalink") 版本歷史 * 在 GitLab 企業版 8.9 中引入. * 與組合使用地理[多節點架構](../../reference_architectures/index.html)在考慮**一般可用** (GA) [GitLab 高級](https://about.gitlab.com/pricing/) 10.4\. 使用 Geo 復制是廣泛分布的開發團隊的解決方案. ## Overview[](#overview "Permalink") 對于遠離單個 GitLab 實例的團隊而言,獲取大型存儲庫可能需要很長時間. Geo 提供您的 GitLab 實例的本地只讀實例. 這樣可以減少克隆和獲取大型存儲庫所需的時間,從而加快開發速度. **注意:**在設置 Geo 之前,請仔細檢查[要求](#requirements-for-running-geo) . 有關 Geo 的視頻介紹,請參見[GitLab Geo-GitLab 功能介紹](https://www.youtube.com/watch?v=-HDLxSjEh6w) . **注意:**從發布到發布,Geo 進行了重大更改. **支持**升級和[記錄](#updating-geo) ,但你應該確保您使用的文件的正確的版本進行安裝. 為確保您使用的文檔版本正確,請[在 GitLab.com 上](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/administration/geo/replication/index.md)導航[至此頁面的源版本](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/administration/geo/replication/index.md) ,然后從**Switch 分支/標簽**下拉列表中選擇適當的版本. 例如, [`v11.2.3-ee`](https://gitlab.com/gitlab-org/gitlab/blob/v11.2.3-ee/doc/administration/geo/replication/index.md) . ## Use cases[](#use-cases "Permalink") 實施 Geo 具有以下好處: * 將分布式開發人員克隆和獲取大型存儲庫和項目所需的時間從幾分鐘減少到幾秒鐘. * 無論您身在何處,都可以使所有開發人員共同貢獻想法并并行工作. * 平衡**主**節點和**輔助**節點之間的只讀負載. 此外,它: * 除讀取 GitLab Web 界面中可用的任何數據外,還可用于克隆和獲取項目(請參閱[當前限制](#current-limitations) ). * 克服遠程辦公室之間的慢速連接,通過提高分布式團隊的速度來節省時間. * 幫助減少自動任務,自定義集成和內部工作流程的加載時間. * 可以在[災難恢復](../disaster_recovery/index.html)方案中快速故障轉移到**輔助**節點. * 允許[計劃的故障轉移](../disaster_recovery/planned_failover.html)到**輔助**節點. 地理位置提供: * 只讀**輔助**節點:維護一個**主** GitLab 節點,同時仍為每個分布式團隊啟用只讀**輔助**節點. * 身份驗證系統掛鉤: **輔助**節點從**主**實例接收所有身份驗證數據(例如用戶帳戶和登錄名). * 直觀的用戶界面: **輔助**節點使用團隊已習慣的相同 Web 界面. 此外,還有可視通知會阻止寫操作,并清楚表明用戶在**輔助**節點上. ## How it works[](#how-it-works "Permalink") 除了讀取任何數據外,您的 Geo 實例還可用于克隆和獲取項目. 這將使在較大距離上使用大型存儲庫的速度更快. [![Geo overview](https://img.kancloud.cn/3a/dd/3add80c5ee4f87a28ac062bf7294ca6c_1540x1200.png)](img/geo_overview.png) 啟用地理位置后,: * 原始實例稱為**主要**節點. * 復制的只讀節點稱為**輔助**節點. 請記住: * **輔助**節點與**主**節點對話以: * 獲取用于登錄的用戶數據(API). * 復制存儲庫,LFS 對象和附件(HTTPS + JWT). * 從 GitLab Premium 10.0 開始, **主**節點不再與**輔助**節點對話以通知更改(API). * [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3 中[引入](https://about.gitlab.com/releases/2018/09/22/gitlab-11-3-released/)了直接推送到**輔助**節點(對于 HTTP 和 SSH,包括 Git LFS). * 當前的實施存在[局限性](#current-limitations) . ### Architecture[](#architecture "Permalink") 下圖說明了 Geo 的基礎體系結構. [![Geo architecture](https://img.kancloud.cn/df/46/df46f240bd1ee71d25036c347ec2b792_1059x1168.png)](img/geo_architecture.png) 在此圖中: * 有**主**節點和一個**輔助**節點的詳細信息. * 只能在**主**節點上執行對數據庫的寫入. **輔助**節點通過 PostgreSQL 流復制接收數據庫更新. * 如果存在,則應將[LDAP 服務器](#ldap)配置為針對[災難恢復](../disaster_recovery/index.html)方案進行復制. * **輔助**節點使用受 JWT 保護的特殊授權對**主要**節點執行不同類型的同步: * 存儲庫是通過 HTTPS 上的 Git 克隆/更新的. * 使用專用 API 端點通過 HTTPS 下載附件,LFS 對象和其他文件. 從用戶執行 Git 操作的角度來看: * **主**節點的行為就像一個完整的讀寫 GitLab 實例. * **輔助**節點是只讀的,但代理 Git 將操作推送到**主**節點. 這使得**輔助**節點似乎本身就支持推送操作. 為了簡化該圖,省略了一些必要的組件. 注意: * SSH 上的 Git 需要[`gitlab-shell`](https://gitlab.com/gitlab-org/gitlab-shell)和 OpenSSH. * 通過 HTTPS 進行 Git 時需要[`gitlab-workhorse`](https://gitlab.com/gitlab-org/gitlab-workhorse) . 請注意, **輔助**節點需要兩個不同的 PostgreSQL 數據庫: * 一個只讀數據庫實例,用于從 GitLab 主數據庫中流式傳輸數據. * **輔助**節點在內部使用的[另一個數據庫實例](#geo-tracking-database)記錄已復制的數據. 在**輔助**節點中,還有一個附加的守護進程: [Geo Log Cursor](#geo-log-cursor) . ## Requirements for running Geo[](#requirements-for-running-geo "Permalink") 要運行 Geo,必須具備以下條件: * 支持 OpenSSH 6.9+的操作系統(需要[在數據庫中快速查找授權的 SSH 密鑰](../../operations/fast_ssh_key_lookup.html) )當前已知版本的 OpenSSH 隨附了以下操作系統: * [CentOS](https://www.centos.org) 7.4 以上 * [Ubuntu](https://ubuntu.com) 16.04 以上 * PostgreSQL 11+ with [FDW](https://s0www0postgresql0org.icopy.site/docs/11/postgres-fdw.html) support and [Streaming Replication](https://wiki.postgresql.org/wiki/Streaming_Replication) * 轉到 2.9+ * 所有節點必須運行相同的 GitLab 版本. 此外,請檢查 GitLab 的[最低要求](../../../install/requirements.html) ,我們建議您使用: * 至少具有 GitLab 企業版 10.0 的基本地理功能. * 最新版本以獲得更好的體驗. ### Firewall rules[](#firewall-rules "Permalink") 下表列出了在 Geo 的**主**節點和**輔助**節點之間必須打開的基本端口. | **Primary** node | **Secondary** node | Protocol | | --- | --- | --- | | 80 | 80 | HTTP | | 443 | 443 | TCP 或 HTTPS | | 22 | 22 | TCP | | 5432 | ? | PostgreSQL | 在[Package 默認值中](https://docs.gitlab.com/omnibus/package-information/defaults.html)查看 GitLab 使用的端口的完整列表 **注意:** [Web 終端](../../../ci/environments/index.html#web-terminals)支持要求您的負載平衡器正確處理 WebSocket 連接. 當使用 HTTP 或 HTTPS 代理,負載平衡器必須被配置為通過`Connection`和`Upgrade`逐跳頭. 有關更多詳細信息,請參見[Web 終端](../../integration/terminal.html)集成指南.**注意:**將 HTTPS 協議用于端口 443 時,您需要向負載均衡器添加 SSL 證書. 如果您想在 GitLab 應用程序服務器上終止 SSL,請使用 TCP 協議. ### LDAP[](#ldap "Permalink") We recommend that if you use LDAP on your **primary** node, you also set up secondary LDAP servers on each **secondary** node. Otherwise, users will not be able to perform Git operations over HTTP(s) on the **secondary** node using HTTP Basic Authentication. However, Git via SSH and personal access tokens will still work. **注意:**所有**輔助**節點都可以共享 LDAP 服務器,但是額外的延遲可能是一個問題. 另外,如果將**輔助**節點提升為**主要**節點,請考慮在[災難恢復](../disaster_recovery/index.html)方案中將使用哪些 LDAP 服務器. 查看有關如何在 LDAP 服務中設置復制的說明. 根據使用的軟件或服務,說明會有所不同. 例如,OpenLDAP 提供了[這些說明](https://www.openldap.org/doc/admin24/replication.html) . ### Geo Tracking Database[](#geo-tracking-database "Permalink") 跟蹤數據庫實例用作元數據,以控制需要在本地實例的磁盤上更新的內容. 例如: * 下載新資產. * 提取新的 LFS 對象. * 從最近更新的存儲庫中獲取更改. 因為復制的數據庫實例是只讀的,所以每個**輔助**節點都需要這個額外的數據庫實例. 跟蹤數據庫需要`postgres_fdw`擴展名. ### Geo Log Cursor[](#geo-log-cursor "Permalink") 該守護程序: * 讀取由**主**節點復制到**輔助**數據庫實例的事件的日志. * 使用需要執行的更改更新地理跟蹤數據庫實例. 在跟蹤數據庫實例中將某些內容標記為要更新時,在**輔助**節點上運行的異步作業將執行所需的操作并更新狀態. 這種新的體系結構使 GitLab 能夠應對節點之間的連接問題. **輔助**節點與**主**節點斷開連接的時間無關緊要,因為它將能夠以正確的順序重放所有事件并再次與**主**節點同步. ## Setup instructions[](#setup-instructions "Permalink") 這些說明假定您有一個 GitLab 的工作實例. 他們指導您: 1. 將現有實例設為**主要**節點. 2. Adding **secondary** nodes. **Caution:** The steps below should be followed in the order they appear. **確保所有節點上的 GitLab 版本均相同.** ### Using Omnibus GitLab[](#using-omnibus-gitlab "Permalink") 如果您使用 Omnibus 軟件包安裝了 GitLab(強烈建議): 1. 在將用作**輔助**節點的服務器上[安裝 GitLab 企業版](https://about.gitlab.com/install/) . 不要創建帳戶或登錄到新的**輔助**節點. 2. 在**主**節點上[載 GitLab 許可](../../../user/admin_area/license.html)以解鎖 Geo. 該許可證必須適用于[GitLab Premium](https://about.gitlab.com/pricing/)或更高版本. 3. [Set up the database replication](database.html) (`primary (read-write) <-> secondary (read-only)` topology). 4. [在數據庫中配置快速查找授權的 SSH 密鑰](../../operations/fast_ssh_key_lookup.html) . 此步驟是必需的,并且必須**同時**在**主**節點和**輔助**節點上完成. 5. [配置 GitLab](configuration.html)以設置**主**節點和**輔助**節點. 6. 可選:為**輔助**節點[配置輔助 LDAP 服務器](../../auth/ldap/index.html) . 請參閱[LDAP 上的注釋](#ldap) . 7. [Follow the “Using a Geo Server” guide](using_a_geo_server.html). ## Post-installation documentation[](#post-installation-documentation "Permalink") 在**輔助**節點上安裝 GitLab 并執行初始配置后,請參閱以下文檔以獲取安裝后信息. ### Configuring Geo[](#configuring-geo "Permalink") 有關配置 Geo 的信息,請參見[Geo 配置](configuration.html) . ### Updating Geo[](#updating-geo "Permalink") 有關如何將 Geo 節點更新到最新的 GitLab 版本的信息,請參見[更新 Geo 節點](updating_the_geo_nodes.html) . ### Pausing and resuming replication[](#pausing-and-resuming-replication "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35913) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2. 在某些情況下,例如在[升級](updating_the_geo_nodes.html)或[計劃的故障轉移](../disaster_recovery/planned_failover.html)期間,最好暫停主數據庫和輔助數據庫之間的復制. 暫停和恢復復制是通過輔助節點上的命令行工具完成的. **暫停:(從中學開始)** ``` gitlab-ctl geo-replication-pause ``` **恢復:(從中學開始)** ``` gitlab-ctl geo-replication-resume ``` ### Configuring Geo for multiple nodes[](#configuring-geo-for-multiple-nodes "Permalink") 有關為多個節點配置 Geo 的信息,請參閱[針對多個服務器的 Geo](multiple_servers.html) . ### Configuring Geo with Object Storage[](#configuring-geo-with-object-storage "Permalink") 有關配置帶對象存儲的 Geo 的信息,請參閱[帶對象存儲的 Geo](object_storage.html) . ### Disaster Recovery[](#disaster-recovery "Permalink") 有關在災難恢復情況下使用 Geo 減輕數據丟失和恢復服務的信息,請參閱[災難恢復](../disaster_recovery/index.html) . ### Replicating the Container Registry[](#replicating-the-container-registry "Permalink") 有關如何復制 Container Registry 的更多信息,請參閱[**輔助**節點的 Docker Registry](docker_registry.html) . ### Security Review[](#security-review "Permalink") 有關地理安全的更多信息,請參閱[地理安全審閱](security_review.html) . ### Tuning Geo[](#tuning-geo "Permalink") 有關調整 Geo 的更多信息,請參見[調整 Geo](tuning.html) . ### Set up a location-aware Git URL[](#set-up-a-location-aware-git-url "Permalink") 有關如何使用 AWS Route53 設置位置感知的 Git 遠程 URL 的示例,請參閱使用 AWS Route53 [感知位置的 Git 遠程 URL](location_aware_git_url.html) . ## Remove Geo node[](#remove-geo-node "Permalink") For more information on removing a Geo node, see [Removing **secondary** Geo nodes](remove_geo_node.html). ## Disable Geo[](#disable-geo "Permalink") 要了解如何禁用地理位置,請參閱[禁用地理位置](disable_geo.html) . ## Current limitations[](#current-limitations "Permalink") **注意:**此限制列表僅反映最新版本的 GitLab. 如果您使用的是舊版本,則可能存在其他限制. * 將請求直接推送到**輔助**節點(對于 HTTP)或代理(對于 SSH)??會將請求重定向到**主要**節點,而不是[直接處理它](https://gitlab.com/gitlab-org/gitlab/-/issues/1381) ,除非在 HTTP 中使用 Git over HTTP 并在 URI 中嵌入憑據. 例如, `https://user:password@secondary.tld` . * 克隆,拉動或推送存在于**主**節點上但不存在于**輔助**節點上的存儲庫,這些存儲庫中的[選擇性同步](configuration.html#selective-synchronization)不包括項目,因此不支持通過 SSH 進行, [但已計劃進行支持](https://gitlab.com/groups/gitlab-org/-/epics/2562) . 支持 HTTP(S). * **主**節點必須在線才能進行 OAuth 登錄. 現有會話和 Git 均不受影響. [正在計劃](https://gitlab.com/gitlab-org/gitlab/-/issues/208465)支持**輔助**節點使用獨立于主節點的 OAuth 提供程序. * 安裝過程需要執行多個手動步驟,根據具體情況,總共可能需要一個小時的時間. 我們正在努力改善這種體驗. 有關詳細信息,請參見[Omnibus GitLab 第 2978](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/2978)期. * 問題/合并請求的實時更新(例如,通過長輪詢)在**輔助**節點上不起作用. * [選擇性同步](configuration.html#selective-synchronization)僅適用于文件和存儲庫. 其他數據集已完全復制到**輔助**節點,使其不適合用作訪問控制機制. * 用于分支項目重復數據刪除的對象池僅在**主**節點上工作,并在**輔助**節點上重復. * [如果外部合并請求差異](../../merge_request_diffs.html)在磁盤上,則將不會復制它們,并且查看合并請求將失敗. 但是,支持對象存儲**中的**外部 MR 差異. 默認配置(數據庫中)起作用. * GitLab Runners 無法向**輔助**節點注冊. [計劃在將來](https://gitlab.com/gitlab-org/gitlab/-/issues/3294)對此提供支持. ### Limitations on replication/verification[](#limitations-on-replicationverification "Permalink") 您可以跟蹤實現這些史詩/問題中缺少的項目的進度: * [Unreplicated Data Types](https://gitlab.com/groups/gitlab-org/-/epics/893) * [Verify all replicated data](https://gitlab.com/groups/gitlab-org/-/epics/1430) 這里有所有 GitLab [數據類型](datatypes.html)的完整列表以及[對復制和驗證的現有支持](datatypes.html#limitations-on-replicationverification) . ## Frequently Asked Questions[](#frequently-asked-questions "Permalink") 有關常見問題的答案,請參見[地理位置常見問題解答](faq.html) . ## Log files[](#log-files "Permalink") 自 GitLab 9.5 起,Geo 將結構化日志消息存儲在`geo.log`文件中. 對于 Omnibus 安裝,此文件位于`/var/log/gitlab/gitlab-rails/geo.log` . 該文件包含有關 Geo 何時嘗試同步存儲庫和文件的信息. 文件中的每一行都包含一個可以提取的單獨的 JSON 條目. 例如,Elasticsearch 或 Splunk. 例如: ``` {"severity":"INFO","time":"2017-08-06T05:40:16.104Z","message":"Repository update","project_id":1,"source":"repository","resync_repository":true,"resync_wiki":true,"class":"Gitlab::Geo::LogCursor::Daemon","cursor_delay_s":0.038} ``` 此消息表明,Geo 檢測到項目`1`需要存儲庫更新. ## Troubleshooting[](#troubleshooting "Permalink") 有關故障排除步驟,請參閱[地理故障排除](troubleshooting.html) .
                  <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>

                              哎呀哎呀视频在线观看