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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Geo for multiple nodes > 原文:[https://docs.gitlab.com/ee/administration/geo/replication/multiple_servers.html](https://docs.gitlab.com/ee/administration/geo/replication/multiple_servers.html) * [Architecture overview](#architecture-overview) * [Redis and PostgreSQL for multiple nodes](#redis-and-postgresql-for-multiple-nodes) * [Prerequisites: Two working GitLab multi-node clusters](#prerequisites-two-working-gitlab-multi-node-clusters) * [Configure the GitLab cluster to be the **primary** node](#configure-the-gitlab-cluster-to-be-the-primary-node) * [Step 1: Configure the **primary** frontend servers](#step-1-configure-the-primary-frontend-servers) * [Step 2: Configure the **primary** database](#step-2-configure-the-primary-database) * [Configure a **secondary** node](#configure-a-secondary-node) * [Step 1: Configure the Redis and Gitaly services on the **secondary** node](#step-1-configure-the-redis-and-gitaly-services-on-the-secondary-node) * [Step 2: Configure the main read-only replica PostgreSQL database on the **secondary** node](#step-2-configure-the-main-read-only-replica-postgresql-database-on-the-secondary-node) * [Step 3: Configure the tracking database on the **secondary** node](#step-3-configure-the-tracking-database-on-the-secondary-node) * [Step 4: Configure the frontend application servers on the **secondary** node](#step-4-configure-the-frontend-application-servers-on-the-secondary-node) * [Step 5: Set up the LoadBalancer for the **secondary** node](#step-5-set-up-the-loadbalancer-for-the-secondary-node) * [Step 6: Configure the backend application servers on the **secondary** node](#step-6-configure-the-backend-application-servers-on-the-secondary-node) # Geo for multiple nodes[](#geo-for-multiple-nodes-premium-only "Permalink") 本文檔介紹了用于在多節點配置中運行 Geo 的最小參考架構. 如果您的多節點設置與所描述的不同,則可以根據需要調整這些說明. ## Architecture overview[](#architecture-overview "Permalink") [![Geo multi-node diagram](https://img.kancloud.cn/98/8d/988df331f04bdf492b62e6808794abe0_960x718.png)](../../high_availability/img/geo-ha-diagram.png) *[diagram source - GitLab employees only](https://docs.google.com/drawings/d/1z0VlizKiLNXVVVaERFwgsIOuEgjcUqDTWPdQYsE7Z4c/edit)* 上面的拓撲假定**主要**和**輔助**地理集群位于兩個單獨的位置,位于它們自己的具有專用 IP 地址的虛擬網絡上. 網絡配置為使一個地理位置內的所有計算機都可以使用其專用 IP 地址相互通信. 給出的 IP 地址只是示例,可能會因部署的網絡拓撲而有所不同. 在上述示例中,訪問這兩個 Geo 部署的唯一外部方法是通過 HTTPS 分別位于`gitlab.us.example.com`和`gitlab.eu.example.com` . **注意:** **主要**和**輔助** Geo 部署必須能夠通過 HTTPS 相互通信. ## Redis and PostgreSQL for multiple nodes[](#redis-and-postgresql-for-multiple-nodes "Permalink") 地理位置支持: * Redis 和 PostgreSQL 在**為主**節點上配置了多個節點. * Redis 在為多個節點配置的**輔助**節點上. **注意:** [已計劃](https://gitlab.com/groups/gitlab-org/-/epics/2536)在多節點配置中在**輔助**節點上支持 PostgreSQL. 由于為 PostgreSQL 和 Redis 設置此配置涉及額外的復雜性,因此此 Geo 多節點文檔未涵蓋該配置. 有關使用 omnibus 軟件包設置多節點 PostgreSQL 集群和 Redis 集群的更多信息,請分別參見[PostgreSQL](../../postgresql/replication_and_failover.html)和[Redis](../../redis/replication_and_failover.html)的多節點文檔. **注意:**可以將云托管服務用于 PostgreSQL 和 Redis,但這不在本文檔的范圍之內. ## Prerequisites: Two working GitLab multi-node clusters[](#prerequisites-two-working-gitlab-multi-node-clusters "Permalink") 一個群集將充當**主**節點. 使用[GitLab 多節點文檔](../../reference_architectures/index.html)進行設置. 如果您已經有一個正在使用的工作 GitLab 實例,則可以將其用作**primary** . The second cluster will serve as the **secondary** node. Again, use the [GitLab multi-node documentation](../../reference_architectures/index.html) to set this up. It’s a good idea to log in and test it, however, note that its data will be wiped out as part of the process of replicating from the **primary**. ## Configure the GitLab cluster to be the **primary** node[](#configure-the-gitlab-cluster-to-be-the-primary-node "Permalink") 通過以下步驟,GitLab 集群可以用**作主**節點. ### Step 1: Configure the **primary** frontend servers[](#step-1-configure-the-primary-frontend-servers "Permalink") 1. 編輯`/etc/gitlab/gitlab.rb`并添加以下內容: ``` ## ## Enable the Geo primary role ## roles ['geo_primary_role'] ## ## The unique identifier for the Geo node. ## gitlab_rails['geo_node_name'] = '<node_name_here>' ## ## Disable automatic migrations ## gitlab_rails['auto_migrate'] = false ``` 進行這些更改后,請[重新配置 GitLab,](../../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. **注意:**在正常的 GitLab 多節點設置過程中,應已在應用程序服務器上禁用 PostgreSQL 和 Redis,并且已配置從應用程序服務器到后端服務器上的那些服務的連接. 請參閱[PostgreSQL](../../postgresql/replication_and_failover.html#configuring-the-application-nodes)和[Redis 的](../../redis/replication_and_failover.html#example-configuration-for-the-gitlab-application)多節點配置文檔. ### Step 2: Configure the **primary** database[](#step-2-configure-the-primary-database "Permalink") 1. 編輯`/etc/gitlab/gitlab.rb`并添加以下內容: ``` ## ## Configure the Geo primary role and the PostgreSQL role ## roles ['geo_primary_role', 'postgres_role'] ``` ## Configure a **secondary** node[](#configure-a-secondary-node "Permalink") **輔助**群集與任何其他 GitLab 多節點群集相似,但有兩個主要區別: * 主 PostgreSQL 數據庫是**主**節點的 PostgreSQL 數據庫的只讀副本. * **輔助**集群還有一個單獨的 PostgreSQL 數據庫,稱為"跟蹤數據庫",該數據庫跟蹤各種資源的同步狀態. 因此,我們將一個接一個地設置多節點組件,并包括與常規多節點設置的偏差. 但是,我們強烈建議您首先配置一個全新的群集,就像它不是地理設置一樣,以便可以對其進行測試和驗證. 只有這樣,才可以對其進行修改以用作 Geo **輔助對象** . 這有助于分離與地理設置無關的問題. ### Step 1: Configure the Redis and Gitaly services on the **secondary** node[](#step-1-configure-the-redis-and-gitaly-services-on-the-secondary-node "Permalink") 再次使用非 Geo 多節點文檔配置以下服務: * 為多個節點[配置 Redis for GitLab](../../redis/replication_and_failover.html#example-configuration-for-the-gitlab-application) . * [Gitaly](../../high_availability/gitaly.html) ,它將存儲從**主**節點同步的數據. **注意:** [NFS](../../high_availability/nfs.html)可以代替 Gitaly 使用,但不建議使用. ### Step 2: Configure the main read-only replica PostgreSQL database on the **secondary** node[](#step-2-configure-the-main-read-only-replica-postgresql-database-on-the-secondary-node "Permalink") **注意:**以下文檔假定數據庫將僅在單個節點上運行. [當前不支持](https://gitlab.com/groups/gitlab-org/-/epics/2536) **輔助**節點上的多節點 PostgreSQL. 配置[**輔助**數據庫](database.html)作為**主**數據庫的一個只讀副本. 使用以下內容作為指導. 1. 為數據庫用戶生成所需密碼的 MD5 哈希,GitLab 應用程序將使用該密碼來訪問只讀副本數據庫: 請注意,用戶名(默認情況下為`gitlab` )已合并到哈希中. ``` gitlab-ctl pg-password-md5 gitlab # Enter password: <your_password_here> # Confirm password: <your_password_here> # fca0b89a972d69f00eb3ec98a5838484 ``` 在下一步中使用此哈希值填寫`<md5_hash_of_your_password>` . 2. 在副本數據庫計算機中編輯`/etc/gitlab/gitlab.rb` ,并添加以下內容: ``` ## ## Configure the Geo secondary role and the PostgreSQL role ## roles ['geo_secondary_role', 'postgres_role'] ## ## Secondary address ## - replace '<secondary_node_ip>' with the public or VPC address of your Geo secondary node ## - replace '<tracking_database_ip>' with the public or VPC address of your Geo tracking database node ## postgresql['listen_address'] = '<secondary_node_ip>' postgresql['md5_auth_cidr_addresses'] = ['<secondary_node_ip>/32', '<tracking_database_ip>/32'] ## ## Database credentials password (defined previously in primary node) ## - replicate same values here as defined in primary node ## postgresql['sql_user_password'] = '<md5_hash_of_your_password>' gitlab_rails['db_password'] = '<your_password_here>' ## ## When running the Geo tracking database on a separate machine, disable it ## here and allow connections from the tracking database host. And ensure ## the tracking database IP is in postgresql['md5_auth_cidr_addresses'] above. ## geo_postgresql['enable'] = false ## ## Disable `geo_logcursor` service so Rails doesn't get configured here ## geo_logcursor['enable'] = false ``` 進行這些更改后,請[重新配置 GitLab,](../../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. 如果使用外部 PostgreSQL 實例,另請參閱使用外部 PostgreSQL 實例的[Geo](external_database.html) . ### Step 3: Configure the tracking database on the **secondary** node[](#step-3-configure-the-tracking-database-on-the-secondary-node "Permalink") **注意:**本文檔假定跟蹤數據庫將僅在一臺計算機上運行,??而不是作為 PostgreSQL 集群運行. 配置跟蹤數據庫. 1. Generate an MD5 hash of the desired password for the database user that the GitLab application will use to access the tracking database: 請注意,用戶名(默認為`gitlab_geo` )已合并到哈希中. ``` gitlab-ctl pg-password-md5 gitlab_geo # Enter password: <your_password_here> # Confirm password: <your_password_here> # fca0b89a972d69f00eb3ec98a5838484 ``` 在下一步中,使用此哈希值填寫`<tracking_database_password_md5_hash>` . 2. 在跟蹤數據庫計算機中編輯`/etc/gitlab/gitlab.rb` ,并添加以下內容: ``` ## ## Enable the Geo secondary tracking database ## geo_postgresql['enable'] = true geo_postgresql['listen_address'] = '<ip_address_of_this_host>' geo_postgresql['sql_user_password'] = '<tracking_database_password_md5_hash>' ## ## Configure FDW connection to the replica database ## geo_secondary['db_fdw'] = true geo_postgresql['fdw_external_password'] = '<replica_database_password_plaintext>' geo_postgresql['md5_auth_cidr_addresses'] = ['<replica_database_ip>/32'] gitlab_rails['db_host'] = '<replica_database_ip>' # Prevent reconfigure from attempting to run migrations on the replica DB gitlab_rails['auto_migrate'] = false ## ## Disable all other services that aren't needed, since we don't have a role ## that does this. ## alertmanager['enable'] = false consul['enable'] = false gitaly['enable'] = false gitlab_exporter['enable'] = false gitlab_workhorse['enable'] = false nginx['enable'] = false node_exporter['enable'] = false pgbouncer_exporter['enable'] = false postgresql['enable'] = false prometheus['enable'] = false redis['enable'] = false redis_exporter['enable'] = false repmgr['enable'] = false sidekiq['enable'] = false puma['enable'] = false ``` 進行這些更改后,請[重新配置 GitLab,](../../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. 如果使用外部 PostgreSQL 實例,另請參閱使用外部 PostgreSQL 實例的[Geo](external_database.html) . ### Step 4: Configure the frontend application servers on the **secondary** node[](#step-4-configure-the-frontend-application-servers-on-the-secondary-node "Permalink") 在體系結構概述中,有兩臺機器運行 GitLab 應用程序服務. 這些服務在配置中有選擇地啟用. 在[為多個節點配置 GitLab](../../high_availability/gitlab.html)之后, [配置](../../high_availability/gitlab.html)應用程序服務器,然后進行以下修改: 1. 在**輔助**集群中的每個應用程序服務器上編輯`/etc/gitlab/gitlab.rb` ,并添加以下內容: ``` ## ## Enable the Geo secondary role ## roles ['geo_secondary_role', 'application_role'] ## ## The unique identifier for the Geo node. ## gitlab_rails['geo_node_name'] = '<node_name_here>' ## ## Disable automatic migrations ## gitlab_rails['auto_migrate'] = false ## ## Configure the connection to the tracking DB. And disable application ## servers from running tracking databases. ## geo_secondary['db_host'] = '<geo_tracking_db_host>' geo_secondary['db_password'] = '<geo_tracking_db_password>' geo_postgresql['enable'] = false ## ## Configure connection to the streaming replica database, if you haven't ## already ## gitlab_rails['db_host'] = '<replica_database_host>' gitlab_rails['db_password'] = '<replica_database_password>' ## ## Configure connection to Redis, if you haven't already ## gitlab_rails['redis_host'] = '<redis_host>' gitlab_rails['redis_password'] = '<redis_password>' ## ## If you are using custom users not managed by Omnibus, you need to specify ## UIDs and GIDs like below, and ensure they match between servers in a ## cluster to avoid permissions issues ## user['uid'] = 9000 user['gid'] = 9000 web_server['uid'] = 9001 web_server['gid'] = 9001 registry['uid'] = 9002 registry['gid'] = 9002 ``` **注意:**如果使用 omnibus 軟件包設置了 PostgreSQL 集群,并且設置了`postgresql['sql_user_password'] = 'md5 digest of secret'`設置,請記住`gitlab_rails['db_password']`和`geo_secondary['db_password']`上面提到的包含明文密碼. 這用于讓 Rails 服務器連接到數據庫.**注意:**確保在遠程數據庫的`postgresql['md5_auth_cidr_addresses']`設置中列出了當前節點 IP. 進行這些更改后,請[重新配置 GitLab,](../../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. 在輔助服務器上,將啟用以下 GitLab 前端服務: * `geo-logcursor` * `gitlab-pages` * `gitlab-workhorse` * `logrotate` * `nginx` * `registry` * `remote-syslog` * `sidekiq` * `puma` 通過在前端應用程序服務器上運行`sudo gitlab-ctl status`來驗證這些服務. ### Step 5: Set up the LoadBalancer for the **secondary** node[](#step-5-set-up-the-loadbalancer-for-the-secondary-node "Permalink") 在這種拓撲中,每個地理位置都需要一個負載平衡器,以將流量路由到應用程序服務器. 有關更多信息,請參見[具有多個節點的 GitLab 的 Load Balancer](../../high_availability/load_balancer.html) . ### Step 6: Configure the backend application servers on the **secondary** node[](#step-6-configure-the-backend-application-servers-on-the-secondary-node "Permalink") 上面的最小參考體系結構圖顯示了在同一臺計算機上一起運行的所有應用程序服務. 但是,對于多個節點,我們[強烈建議單獨運行所有服務](../../reference_architectures/index.html) . 例如,可以將 Sidekiq 服務器配置為與上面的前端應用程序服務器類似,但要進行一些更改以僅運行`sidekiq`服務: 1. 在**輔助**群集中的每個 Sidekiq 服務器上編輯`/etc/gitlab/gitlab.rb` ,并添加以下內容: ``` ## ## Enable the Geo secondary role ## roles ['geo_secondary_role'] ## ## Enable the Sidekiq service ## sidekiq['enable'] = true ## ## Ensure unnecessary services are disabled ## alertmanager['enable'] = false consul['enable'] = false geo_logcursor['enable'] = false gitaly['enable'] = false gitlab_exporter['enable'] = false gitlab_workhorse['enable'] = false nginx['enable'] = false node_exporter['enable'] = false pgbouncer_exporter['enable'] = false postgresql['enable'] = false prometheus['enable'] = false redis['enable'] = false redis_exporter['enable'] = false repmgr['enable'] = false puma['enable'] = false ## ## The unique identifier for the Geo node. ## gitlab_rails['geo_node_name'] = '<node_name_here>' ## ## Disable automatic migrations ## gitlab_rails['auto_migrate'] = false ## ## Configure the connection to the tracking DB. And disable application ## servers from running tracking databases. ## geo_secondary['db_host'] = '<geo_tracking_db_host>' geo_secondary['db_password'] = '<geo_tracking_db_password>' geo_postgresql['enable'] = false ## ## Configure connection to the streaming replica database, if you haven't ## already ## gitlab_rails['db_host'] = '<replica_database_host>' gitlab_rails['db_password'] = '<replica_database_password>' ## ## Configure connection to Redis, if you haven't already ## gitlab_rails['redis_host'] = '<redis_host>' gitlab_rails['redis_password'] = '<redis_password>' ## ## If you are using custom users not managed by Omnibus, you need to specify ## UIDs and GIDs like below, and ensure they match between servers in a ## cluster to avoid permissions issues ## user['uid'] = 9000 user['gid'] = 9000 web_server['uid'] = 9001 web_server['gid'] = 9001 registry['uid'] = 9002 registry['gid'] = 9002 ``` 您可以類似地將服務器配置為僅運行`geo_logcursor['enable'] = true`的`geo-logcursor`服務,并使用`sidekiq['enable'] = false`禁用 Sidekiq. 這些服務器不需要連接到負載平衡器.
                  <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>

                              哎呀哎呀视频在线观看