<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Reference architecture: up to 2,000 users > 原文:[https://docs.gitlab.com/ee/administration/reference_architectures/2k_users.html](https://docs.gitlab.com/ee/administration/reference_architectures/2k_users.html) * [Setup components](#setup-components) * [Configure the load balancer](#configure-the-load-balancer) * [Application node terminates SSL](#application-node-terminates-ssl) * [Load balancer terminates SSL without backend SSL](#load-balancer-terminates-ssl-without-backend-ssl) * [Load balancer terminates SSL with backend SSL](#load-balancer-terminates-ssl-with-backend-ssl) * [Ports](#ports) * [Alternate SSH Port](#alternate-ssh-port) * [Configure PostgreSQL](#configure-postgresql) * [Provide your own PostgreSQL instance](#provide-your-own-postgresql-instance) * [Standalone PostgreSQL using Omnibus GitLab](#standalone-postgresql-using-omnibus-gitlab) * [Configure Redis](#configure-redis) * [Provide your own Redis instance](#provide-your-own-redis-instance) * [Standalone Redis using Omnibus GitLab](#standalone-redis-using-omnibus-gitlab) * [Configure Gitaly](#configure-gitaly) * [Gitaly TLS support](#gitaly-tls-support) * [Configure GitLab Rails](#configure-gitlab-rails) * [Configure Prometheus](#configure-prometheus) * [Configure the object storage](#configure-the-object-storage) * [Configure NFS (optional)](#configure-nfs-optional) * [Troubleshooting](#troubleshooting) # Reference architecture: up to 2,000 users[](#reference-architecture-up-to-2000-users "Permalink") 該頁面描述了最多可容納 2,000 位用戶的 GitLab 參考架構. 有關參考架構的完整列表,請參見[可用參考架構](index.html#available-reference-architectures) . > * **支持的用戶(大約):** 2,000 > * **高可用性:** False > * **每秒測試請求(RPS)速率:** API:40 RPS,Web:4 RPS,Git:4 RPS | Service | Nodes | Configuration | GCP | AWS | Azure | | --- | --- | --- | --- | --- | --- | | 負載均衡器 | 1 | 2 個 vCPU,1.8GB 內存 | `n1-highcpu-2` | `c5.large` | `F2s v2` | | PostgreSQL | 1 | 2 個 vCPU,7.5GB 內存 | `n1-standard-2` | `m5.large` | `D2s v3` | | Redis | 1 | 1 個 vCPU,3.75GB 內存 | `n1-standard-1` | `m5.large` | `D2s v3` | | Gitaly | 1 | 4 個 vCPU,15GB 內存 | `n1-standard-4` | `m5.xlarge` | `D4s v3` | | 亞搏體育 app Rails | 2 | 8 個 vCPU,7.2GB 內存 | `n1-highcpu-8` | `c5.2xlarge` | `F8s v2` | | 監控節點 | 1 | 2 個 vCPU,1.8GB 內存 | `n1-highcpu-2` | `c5.large` | `F2s v2` | | 對象存儲 | n/a | n/a | n/a | n/a | n/a | | NFS 服務器(可選,不推薦) | 1 | 4 個 vCPU,3.6GB 內存 | `n1-highcpu-4` | `c5.xlarge` | `F4s v2` | Google Cloud Platform(GCP)架構是使用[Intel Xeon E5 v3(Haswell)](https://cloud.google.com/compute/docs/cpu-platforms) CPU 平臺構建和測試的. 在不同的硬件上,您可能會發現需要對 CPU 或節點數進行更低或更高的調整. 有關更多信息,請參見我們基于[Sysbench](https://github.com/akopytov/sysbench)的[CPU 基準測試](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Reference-Architectures/GCP-CPU-Benchmarks) . 由于具有更好的性能和可用性,對于數據對象(例如 LFS,上載或工件),建議使用[對象存儲服務](#configure-the-object-storage)而不是 NFS. 使用對象存儲服務也不需要您配置和維護節點. ## Setup components[](#setup-components "Permalink") 設置 GitLab 及其組件以容納多達 2,000 個用戶: 1. [配置外部負載平衡節點](#configure-the-load-balancer)以處理兩個 GitLab 應用程序服務節點的負載平衡. 2. [配置 PostgreSQL](#configure-postgresql) (GitLab 的數據庫). 3. [Configure Redis](#configure-redis). 4. [配置 Gitaly](#configure-gitaly) ,它提供對 Git 存儲庫的訪問. 5. [配置主要的 GitLab Rails 應用程序](#configure-gitlab-rails)以運行 Puma / Unicorn,Workhorse,GitLab Shell,并滿足所有前端請求(包括 UI,API 和基于 HTTP / SSH 的 Git). 6. [配置 Prometheus](#configure-prometheus)來監視您的 GitLab 環境. 7. [配置](#configure-the-object-storage)用于共享數據對象[的對象存儲](#configure-the-object-storage) . 8. [配置 NFS](#configure-nfs-optional) (可選,不建議使用)以具有共享磁盤存儲服務,以替代 Gitaly 或對象存儲. 如果您不使用 GitLab 頁面(需要 NFS),則可以跳過此步驟. ## Configure the load balancer[](#configure-the-load-balancer "Permalink") **注意:**此體系結構已經過[HAProxy 的](https://www.haproxy.org/)測試和驗證. 盡管您可以使用具有類似功能的負載均衡器,但 GitLab 尚未驗證其他負載均衡器. 在主動/主動 GitLab 配置中,您需要一個負載平衡器才能將流量路由到應用程序服務器. GitLab 文檔超出了使用負載平衡器或其確切配置的詳細信息. 如果要管理多節點系統(包括 GitLab),則可能已經選擇了負載均衡器. 一些示例包括 HAProxy(開源),F5 Big-IP LTM 和 Citrix Net Scaler. 本文檔包括與 GitLab 一起使用的端口和協議. 下一個問題是如何在環境中處理 SSL. 有幾種不同的選擇: * [The application node terminates SSL](#application-node-terminates-ssl). * [負載平衡器終止沒有后端 SSL 的 SSL,](#load-balancer-terminates-ssl-without-backend-ssl)并且負載平衡器與應用程序節點之間的通信不安全. * [負載均衡器使用后端 SSL 終止 SSL,](#load-balancer-terminates-ssl-with-backend-ssl)并且負載均衡器與應用程序節點之間的通信是*安全*的. ### Application node terminates SSL[](#application-node-terminates-ssl "Permalink") 配置您的負載均衡器以將端口 443 上的連接作為`TCP`而不是`HTTP(S)`傳遞. 這會將連接保持不變地傳遞到應用程序節點的 NGINX 服務,該服務具有 SSL 證書并偵聽端口 443. 有關管理 SSL 證書和配置 NGINX 的詳細信息,請參見[NGINX HTTPS 文檔](https://docs.gitlab.com/omnibus/settings/nginx.html) . ### Load balancer terminates SSL without backend SSL[](#load-balancer-terminates-ssl-without-backend-ssl "Permalink") 將負載平衡器配置為使用`HTTP(S)`協議而不是`TCP` . 負載平衡器將負責管理 SSL 證書和終止 SSL. 由于負載平衡器和 GitLab 之間的通信不安全,因此您需要完成一些其他配置. 有關詳細信息,請參見[NGINX 代理的 SSL 文檔](https://docs.gitlab.com/omnibus/settings/nginx.html) . ### Load balancer terminates SSL with backend SSL[](#load-balancer-terminates-ssl-with-backend-ssl "Permalink") 配置您的負載平衡器(如果只有一個,則為單個平衡器)以使用`HTTP(S)`協議而不是`TCP` . 負載平衡器將負責為最終用戶管理 SSL 證書. 在這種情況下,負載平衡器和 NGINX 之間的流量將是安全的,并且無需為代理 SSL 添加配置. 但是,您需要向 GitLab 添加配置以配置 SSL 證書. 有關管理 SSL 證書和配置 NGINX 的詳細信息,請參見[NGINX HTTPS 文檔](https://docs.gitlab.com/omnibus/settings/nginx.html) . ### Ports[](#ports "Permalink") The basic load balancer ports you should use are described in the following table: | Port | 后端端口 | Protocol | | --- | --- | --- | | 80 | 80 | HTTP( *1* ) | | 443 | 443 | TCP 或 HTTPS( *1* )( *2* ) | | 22 | 22 | TCP | * ( *1* ): [Web 終端](../../ci/environments/index.html#web-terminals)支持要求您的負載平衡器正確處理 WebSocket 連接. 當使用 HTTP 或 HTTPS 代理,負載平衡器必須被配置為通過`Connection`和`Upgrade`逐跳頭. 有關詳細信息,請參見[Web 終端](../integration/terminal.html)集成指南. * ( *2* ):在端口 443 上使用 HTTPS 協議時,您需要向負載均衡器添加 SSL 證書. 如果需要在 GitLab 應用程序服務器上終止 SSL,請使用 TCP 協議. 如果您使用具有自定義域支持的 GitLab 頁面,則將需要一些其他端口配置. GitLab 頁面需要一個單獨的虛擬 IP 地址. 配置 DNS,以將`pages_external_url`的`/etc/gitlab/gitlab.rb`指向新的虛擬 IP 地址. 有關更多信息,請參見[GitLab 頁面文檔](../pages/index.html) . | Port | 后端端口 | Protocol | | --- | --- | --- | | 80 | 變化( *1* ) | HTTP | | 443 | 變化( *1* ) | TCP( *2* ) | * ( *1* ):GitLab 頁面的后端端口取決于`gitlab_pages['external_http']`和`gitlab_pages['external_https']`設置. 有關詳細信息,請參見[GitLab 頁面文檔](../pages/index.html) . * ( *2* ):GitLab 頁面的端口 443 必須使用 TCP 協議. 用戶可以使用自定義 SSL 配置自定義域,如果 SSL 在負載均衡器處終止,則無法實現. #### Alternate SSH Port[](#alternate-ssh-port "Permalink") 某些組織有禁止打開 SSH 端口 22 的策略.在這種情況下,配置備用 SSH 主機名可能會有所幫助,該主機名改為允許用戶通過端口 443 使用 SSH.與先前描述的相比,備用 SSH 主機名需要新的虛擬 IP 地址. GitLab HTTP 配置. 為備用 SSH 主機名配置 DNS,例如`altssh.gitlab.example.com` : | LB 端口 | 后端端口 | Protocol | | --- | --- | --- | | 443 | 22 | TCP | [Back to setup components](#setup-components) ## Configure PostgreSQL[](#configure-postgresql "Permalink") 在本節中,將指導您配置與 GitLab 一起使用的外部 PostgreSQL 數據庫. ### Provide your own PostgreSQL instance[](#provide-your-own-postgresql-instance "Permalink") 如果您將 GitLab 托管在云提供商上,則可以選擇將托管服務用于 PostgreSQL. 例如,AWS 提供了運行 PostgreSQL 的托管關系數據庫服務(RDS). 如果您使用云托管服務,或提供自己的 PostgreSQL: 1. 根據[數據庫要求文檔](../../install/requirements.html#database)設置 PostgreSQL. 2. 使用您選擇的密碼創建一個`gitlab`用戶名. `gitlab`用戶需要特權才能創建`gitlabhq_production`數據庫. 3. 使用適當的詳細信息配置 GitLab 應用程序服務器. [配置 GitLab Rails 應用程序](#configure-gitlab-rails)涵蓋了此步驟. ### Standalone PostgreSQL using Omnibus GitLab[](#standalone-postgresql-using-omnibus-gitlab "Permalink") 1. SSH 進入 PostgreSQL 服務器. 2. 從 GitLab 下載頁面使用**步驟 1 和 2** [下載/安裝](https://about.gitlab.com/install/)所需的 Omnibus GitLab 軟件包. * 不要完成下載頁面上的任何其他步驟. 3. 為 PostgreSQL 生成密碼哈希. 假設您將使用默認用戶名`gitlab` (推薦). 該命令將要求輸入密碼和確認. 將此命令在下一步中輸出的值用作`POSTGRESQL_PASSWORD_HASH`的值. ``` sudo gitlab-ctl pg-password-md5 gitlab ``` 4. 編輯`/etc/gitlab/gitlab.rb`并添加以下內容,以適當地更新占位符值. * `POSTGRESQL_PASSWORD_HASH`上一步的輸出值 * `APPLICATION_SERVER_IP_BLOCKS`將連接到數據庫的 GitLab 應用程序服務器的 IP 子網或 IP 地址的空格分隔列表. 示例: `%w(123.123.123.123/32 123.123.123.234/32)` ``` # Disable all components except PostgreSQL roles ['postgres_role'] repmgr['enable'] = false consul['enable'] = false prometheus['enable'] = false alertmanager['enable'] = false pgbouncer_exporter['enable'] = false redis_exporter['enable'] = false gitlab_exporter['enable'] = false # Set the network addresses that the exporters used for monitoring will listen on node_exporter['listen_address'] = '0.0.0.0:9100' postgres_exporter['listen_address'] = '0.0.0.0:9187' postgres_exporter['dbname'] = 'gitlabhq_production' postgres_exporter['password'] = 'POSTGRESQL_PASSWORD_HASH' # Set the PostgreSQL address and port postgresql['listen_address'] = '0.0.0.0' postgresql['port'] = 5432 # Replace POSTGRESQL_PASSWORD_HASH with a generated md5 value postgresql['sql_user_password'] = 'POSTGRESQL_PASSWORD_HASH' # Replace APPLICATION_SERVER_IP_BLOCK with the CIDR address of the application node postgresql['trust_auth_cidr_addresses'] = %w(127.0.0.1/32 APPLICATION_SERVER_IP_BLOCK) # Disable automatic database migrations gitlab_rails['auto_migrate'] = false ``` 5. [重新配置 GitLab,](../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. 6. 注意 PostgreSQL 節點的 IP 地址或主機名,端口和純文本密碼. 這些在以后配置[GitLab 應用程序服務器](#configure-gitlab-rails)時是必需的. 支持高級[配置選項](https://docs.gitlab.com/omnibus/settings/database.html) ,可以根據需要添加. [Back to setup components](#setup-components) ## Configure Redis[](#configure-redis "Permalink") 在本節中,將指導您配置與 GitLab 一起使用的外部 Redis 實例. ### Provide your own Redis instance[](#provide-your-own-redis-instance "Permalink") 需要 Redis 5.0 或更高版本,因為這是從 GitLab 13.0 開始的 Omnibus GitLab 軟件包附帶的版本. 較舊的 Redis 版本不支持 SPOP 的可選 count 參數,這對于[合并火車](../../ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.html)現在是必需的. 此外,GitLab 還利用了某些命令,例如`UNLINK`和`USAGE` ,這些命令僅在 Redis 4 中引入. 來自云提供商(例如 AWS ElastiCache)的托管 Redis 將可以使用. 如果這些服務支持高可用性,請確保它不是 Redis 群集類型. 注意 Redis 節點的 IP 地址或主機名,端口和密碼(如果需要). 這些在以后配置[GitLab 應用程序服務器](#configure-gitlab-rails)時是必需的. ### Standalone Redis using Omnibus GitLab[](#standalone-redis-using-omnibus-gitlab "Permalink") Omnibus GitLab 軟件包可用于配置獨立的 Redis 服務器. 以下步驟是使用 Omnibus 配置 Redis 服務器的最低必需步驟: 1. SSH 進入 Redis 服務器. 2. 從 GitLab 下載頁面使用**步驟 1 和 2** [下載/安裝](https://about.gitlab.com/install/)所需的 Omnibus GitLab 軟件包. * 不要完成下載頁面上的任何其他步驟. 3. 編輯`/etc/gitlab/gitlab.rb`并添加內容: ``` ## Enable Redis redis['enable'] = true ## Disable all other services sidekiq['enable'] = false gitlab_workhorse['enable'] = false puma['enable'] = false unicorn['enable'] = false postgresql['enable'] = false nginx['enable'] = false prometheus['enable'] = false alertmanager['enable'] = false pgbouncer_exporter['enable'] = false gitlab_exporter['enable'] = false gitaly['enable'] = false grafana['enable'] = false redis['bind'] = '0.0.0.0' redis['port'] = 6379 redis['password'] = 'SECRET_PASSWORD_HERE' gitlab_rails['enable'] = false # Set the network addresses that the exporters used for monitoring will listen on node_exporter['listen_address'] = '0.0.0.0:9100' redis_exporter['listen_address'] = '0.0.0.0:9121' redis_exporter['flags'] = { 'redis.addr' => 'redis://0.0.0.0:6379', 'redis.password' => 'SECRET_PASSWORD_HERE', } ``` 4. [重新配置 Omnibus GitLab,](../restart_gitlab.html#omnibus-gitlab-reconfigure)以使更改生效. 5. 注意 Redis 節點的 IP 地址或主機名,端口和 Redis 密碼. 這些在以后[配置 GitLab 應用程序服務器](#configure-gitlab-rails)時是必需的. 支持高級[配置選項](https://docs.gitlab.com/omnibus/settings/redis.html) ,可以根據需要添加. [Back to setup components](#setup-components) ## Configure Gitaly[](#configure-gitaly "Permalink") 在自己的服務器上部署 Gitaly 可以使大于單個計算機的 GitLab 安裝受益. Gitaly 節點的要求取決于數據,特別是項目的數量及其大小. 建議每個 Gitaly 節點存儲的數據量不得超過 5TB. 您的 2K 設置可能需要一個或多個節點,具體取決于您的存儲庫存儲要求. 我們強烈建議所有 Gitaly 節點都安裝 SSD 磁盤,因為 Gitaly I / O 繁重,因此其讀取操作的吞吐量至少為 8,000 IOPS,寫入操作的吞吐量至少為 2,000 IOPS. 這些 IOPS 值僅建議作為啟動器使用,因為隨著時間的推移,它們可能會根據環境工作負載的規模而調整得更高或更低. 如果您正在 Cloud provider 上運行環境,則可能需要參考其文檔以了解如何正確配置 IOPS. Some things to note: * GitLab Rails 應用程序將[存儲庫分](../repository_storage_paths.html)片到[存儲庫中](../repository_storage_paths.html) . * A Gitaly server can host one or more storages. * 一個 GitLab 服務器可以使用一個或多個 Gitaly 服務器. * 必須以對所有 Gitaly 客戶端正確解析的方式指定 Gitaly 地址. * Gitaly 服務器一定不能暴露在公共互聯網上,因為默認情況下,Gitaly 的網絡流量是未加密的. 強烈建議使用防火墻以限制對 Gitaly 服務器的訪問. 另一種選擇是[使用 TLS](#gitaly-tls-support) . **提示:**有關 Gitaly 歷史和網絡體系結構的更多信息,請參見[獨立的 Gitaly 文檔](../gitaly/index.html) . 注意: **注意:** Gitaly 文檔中引用的令牌只是管理員選擇的任意密碼. 它與為 GitLab API 創建的令牌或其他類似的 Web API 令牌無關. 下面我們將介紹如何配置一個 Gitaly 服務器`gitaly1.internal`與秘密令牌`gitalysecret` . 我們假設您的 GitLab 安裝有兩個存儲庫存儲: `default`和`storage1` . 要配置 Gitaly 服務器: 1. 從 GitLab 下載頁面使用**步驟 1 和 2** [下載/安裝](https://about.gitlab.com/install/)所需的 Omnibus GitLab 軟件包,但**不**提供`EXTERNAL_URL`值. 2. 編輯`/etc/gitlab/gitlab.rb`以配置存儲路徑,啟用網絡偵聽器并配置令牌: ``` # /etc/gitlab/gitlab.rb # Gitaly and GitLab use two shared secrets for authentication, one to authenticate gRPC requests # to Gitaly, and a second for authentication callbacks from GitLab-Shell to the GitLab internal API. # The following two values must be the same as their respective values # of the GitLab Rails application setup gitaly['auth_token'] = 'gitlaysecret' gitlab_shell['secret_token'] = 'shellsecret' # Avoid running unnecessary services on the Gitaly server postgresql['enable'] = false redis['enable'] = false nginx['enable'] = false puma['enable'] = false unicorn['enable'] = false sidekiq['enable'] = false gitlab_workhorse['enable'] = false grafana['enable'] = false # If you run a seperate monitoring node you can disable these services alertmanager['enable'] = false prometheus['enable'] = false # Prevent database connections during 'gitlab-ctl reconfigure' gitlab_rails['rake_cache_clear'] = false gitlab_rails['auto_migrate'] = false # Configure the gitlab-shell API callback URL. Without this, `git push` will # fail. This can be your 'front door' GitLab URL or an internal load # balancer. # Don't forget to copy `/etc/gitlab/gitlab-secrets.json` from web server to Gitaly server. gitlab_rails['internal_api_url'] = 'https://gitlab.example.com' # Make Gitaly accept connections on all network interfaces. You must use # firewalls to restrict access to this address/port. # Comment out following line if you only want to support TLS connections gitaly['listen_addr'] = "0.0.0.0:8075" gitaly['prometheus_listen_addr'] = "0.0.0.0:9236" # Set the network addresses that the exporters used for monitoring will listen on node_exporter['listen_address'] = '0.0.0.0:9100' ``` 3. 將以下內容添加到`/etc/gitlab/gitlab.rb`上的`gitaly1.internal` : ``` git_data_dirs({ 'default' => { 'path' => '/var/opt/gitlab/git-data' }, 'storage1' => { 'path' => '/mnt/gitlab/git-data' }, }) ``` 4. 保存文件并[重新配置 GitLab](../restart_gitlab.html#omnibus-gitlab-reconfigure) . 5. 確認 Gitaly 可以執行對內部 API 的回調: ``` sudo /opt/gitlab/embedded/service/gitlab-shell/bin/check -config /opt/gitlab/embedded/service/gitlab-shell/config.yml ``` ### Gitaly TLS support[](#gitaly-tls-support "Permalink") Gitaly 支持 TLS 加密. 為了能夠與偵聽安全連接的 Gitaly 實例進行通信,您將需要在 GitLab 配置中相應存儲條目的`gitaly_address`中使用`tls://` URL 方案. 您將需要攜帶自己的證書,因為該證書不會自動提供. 證書或其證書頒發機構必須按照[GitLab 自定義證書配置中](https://docs.gitlab.com/omnibus/settings/ssl.html)所述的步驟,安裝在所有 Gitaly 節點(包括使用證書的 Gitaly 節點)上,以及與之通信的所有客戶端節點上. **注意:**自簽名證書必須指定用于訪問 Gitaly 服務器的地址. 如果要通過主機名尋址 Gitaly 服務器,則可以為此使用"公用名"字段,也可以將其添加為"使用者備用名". 如果要通過 Gitaly 服務器的 IP 地址對其進行尋址,則必須將其作為主題備用名稱添加到證書中. [gRPC 不支持在證書中使用 IP 地址作為公用名](https://github.com/grpc/grpc/issues/2691) .**注意:**可以同時為 Gitaly 服務器配置未加密的偵聽地址`listen_addr`和已加密的偵聽地址`tls_listen_addr` . 如果需要,這使您可以從未加密的流量逐漸過渡到加密的流量. 要使用 TLS 配置 Gitaly: 1. 創建`/etc/gitlab/ssl`目錄,并在其中復制密鑰和證書: ``` sudo mkdir -p /etc/gitlab/ssl sudo chmod 755 /etc/gitlab/ssl sudo cp key.pem cert.pem /etc/gitlab/ssl/ sudo chmod 644 key.pem cert.pem ``` 2. 將證書復制到`/etc/gitlab/trusted-certs`以便 Gitaly 在調用自身時信任該證書: ``` sudo cp /etc/gitlab/ssl/cert.pem /etc/gitlab/trusted-certs/ ``` 3. 編輯`/etc/gitlab/gitlab.rb`并添加: ``` gitaly['tls_listen_addr'] = "0.0.0.0:9999" gitaly['certificate_path'] = "/etc/gitlab/ssl/cert.pem" gitaly['key_path'] = "/etc/gitlab/ssl/key.pem" ``` 4. Delete `gitaly['listen_addr']` to allow only encrypted connections. 5. 保存文件并[重新配置 GitLab](../restart_gitlab.html#omnibus-gitlab-reconfigure) . [Back to setup components](#setup-components) ## Configure GitLab Rails[](#configure-gitlab-rails "Permalink") **注意:**在我們的體系結構中,我們使用 Puma Web 服務器運行每個 GitLab Rails 節點,并將其工作程序數設置為可用 CPU 的 90%以及四個線程. 對于運行帶有其他組件的 Rails 的節點,應該相應地降低 worker 的值,我們發現 50%達到了很好的平衡,但這取決于工作量. 本節介紹如何配置 GitLab 應用程序(Rails)組件. 在每個節點上執行以下操作: 1. 如果您[使用的是 NFS](#configure-nfs-optional) : 1. 如有必要,請使用以下命令安裝 NFS 客戶端實用程序軟件包: ``` # Ubuntu/Debian apt-get install nfs-common # CentOS/Red Hat yum install nfs-utils nfs-utils-lib ``` 2. 在`/etc/fstab`指定必要的 NFS 掛載. `/etc/fstab`的確切內容取決于您選擇配置 NFS 服務器的方式. 有關示例和各種選項,請參見[NFS 文檔](../high_availability/nfs.html) . 3. 創建共享目錄. 這些可能會有所不同,具體取決于您的 NFS 安裝位置. ``` mkdir -p /var/opt/gitlab/.ssh /var/opt/gitlab/gitlab-rails/uploads /var/opt/gitlab/gitlab-rails/shared /var/opt/gitlab/gitlab-ci/builds /var/opt/gitlab/git-data ``` 2. 使用[GitLab 下載中的](https://about.gitlab.com/install/) **步驟 1 和 2**下載/安裝 Omnibus GitLab. 不要完成下載頁面上的其他步驟. 3. 創建/編輯`/etc/gitlab/gitlab.rb`并使用以下配置. 為了保持整個節點的鏈接均勻性, `external_url`在應用服務器上應指向外部 URL,用戶將用來訪問 GitLab. 這將是[負載均衡器](#configure-the-load-balancer)的 URL,它將把流量路由到 GitLab 應用程序服務器: ``` external_url 'https://gitlab.example.com' # Gitaly and GitLab use two shared secrets for authentication, one to authenticate gRPC requests # to Gitaly, and a second for authentication callbacks from GitLab-Shell to the GitLab internal API. # The following two values must be the same as their respective values # of the Gitaly setup gitlab_rails['gitaly_token'] = 'gitalyecret' gitlab_shell['secret_token'] = 'shellsecret' git_data_dirs({ 'default' => { 'gitaly_address' => 'tcp://gitaly1.internal:8075' }, 'storage1' => { 'gitaly_address' => 'tcp://gitaly1.internal:8075' }, 'storage2' => { 'gitaly_address' => 'tcp://gitaly2.internal:8075' }, }) ## Disable components that will not be on the GitLab application server roles ['application_role'] gitaly['enable'] = false nginx['enable'] = true ## PostgreSQL connection details gitlab_rails['db_adapter'] = 'postgresql' gitlab_rails['db_encoding'] = 'unicode' gitlab_rails['db_host'] = '10.1.0.5' # IP/hostname of database server gitlab_rails['db_password'] = 'DB password' ## Redis connection details gitlab_rails['redis_port'] = '6379' gitlab_rails['redis_host'] = '10.1.0.6' # IP/hostname of Redis server gitlab_rails['redis_password'] = 'Redis Password' # Set the network addresses that the exporters used for monitoring will listen on node_exporter['listen_address'] = '0.0.0.0:9100' gitlab_workhorse['prometheus_listen_addr'] = '0.0.0.0:9229' sidekiq['listen_address'] = "0.0.0.0" puma['listen'] = '0.0.0.0' # Add the monitoring node's IP address to the monitoring whitelist and allow it to # scrape the NGINX metrics. Replace placeholder `monitoring.gitlab.example.com` with # the address and/or subnets gathered from the monitoring node gitlab_rails['monitoring_whitelist'] = ['<MONITOR NODE IP>/32', '127.0.0.0/8'] nginx['status']['options']['allow'] = ['<MONITOR NODE IP>/32', '127.0.0.0/8'] ## Uncomment and edit the following options if you have set up NFS ## ## Prevent GitLab from starting if NFS data mounts are not available ## #high_availability['mountpoint'] = '/var/opt/gitlab/git-data' ## ## Ensure UIDs and GIDs match between servers for permissions via NFS ## #user['uid'] = 9000 #user['gid'] = 9000 #web_server['uid'] = 9001 #web_server['gid'] = 9001 #registry['uid'] = 9002 #registry['gid'] = 9002 ``` 4. 如果您正在使用[具有 TLS 支持](#gitaly-tls-support)的`git_data_dirs` ,請確保`git_data_dirs`條目配置了`tls`而不是`tcp` : ``` git_data_dirs({ 'default' => { 'gitaly_address' => 'tls://gitaly1.internal:9999' }, 'storage1' => { 'gitaly_address' => 'tls://gitaly1.internal:9999' }, 'storage2' => { 'gitaly_address' => 'tls://gitaly2.internal:9999' }, }) ``` 1. 將證書復制到`/etc/gitlab/trusted-certs` : ``` sudo cp cert.pem /etc/gitlab/trusted-certs/ ``` 5. 保存文件并[重新配置 GitLab](../restart_gitlab.html#omnibus-gitlab-reconfigure) . 6. 運行`sudo gitlab-rake gitlab:gitaly:check`確認節點可以連接到 Gitaly. 7. 拖尾日志以查看請求: ``` sudo gitlab-ctl tail gitaly ``` **注意:**如上例所示,當在`external_url`指定`https`時,GitLab 會假定您在`/etc/gitlab/ssl/`具有 SSL 證書. 如果沒有證書,NGINX 將無法啟動. 有關更多信息,請參見[NGINX 文檔](https://docs.gitlab.com/omnibus/settings/nginx.html) .[Back to setup components](#setup-components) ## Configure Prometheus[](#configure-prometheus "Permalink") The Omnibus GitLab package can be used to configure a standalone Monitoring node running [Prometheus](../monitoring/prometheus/index.html) and [Grafana](../monitoring/performance/grafana_configuration.html): 1. SSH 進入"監視"節點. 2. 從 GitLab 下載頁面使用**步驟 1 和 2** [下載/安裝](https://about.gitlab.com/install/)所需的 Omnibus GitLab 軟件包. 不要完成下載頁面上的任何其他步驟. 3. 編輯`/etc/gitlab/gitlab.rb`并添加內容: ``` external_url 'http://gitlab.example.com' # Enable Prometheus prometheus['enable'] = true prometheus['listen_address'] = '0.0.0.0:9090' prometheus['monitor_kubernetes'] = false # Enable Login form grafana['disable_login_form'] = false # Enable Grafana grafana['enable'] = true grafana['admin_password'] = 'toomanysecrets' # Disable all other services gitlab_rails['auto_migrate'] = false alertmanager['enable'] = false gitaly['enable'] = false gitlab_exporter['enable'] = false gitlab_workhorse['enable'] = false nginx['enable'] = true postgres_exporter['enable'] = false postgresql['enable'] = false redis['enable'] = false redis_exporter['enable'] = false sidekiq['enable'] = false puma['enable'] = false unicorn['enable'] = false node_exporter['enable'] = false gitlab_exporter['enable'] = false ``` 4. Prometheus 還需要一些抓取配置,以從我們配置了導出器的各個節點中提取所有數據. 假設您節點的 IP 為: ``` 1.1.1.1: postgres 1.1.1.2: redis 1.1.1.3: gitaly1 1.1.1.4: rails1 1.1.1.5: rails2 ``` 將以下內容添加到`/etc/gitlab/gitlab.rb` : ``` prometheus['scrape_configs'] = [ { 'job_name': 'postgres', 'static_configs' => [ 'targets' => ['1.1.1.1:9187'], ], }, { 'job_name': 'redis', 'static_configs' => [ 'targets' => ['1.1.1.2:9121'], ], }, { 'job_name': 'gitaly', 'static_configs' => [ 'targets' => ['1.1.1.3:9236'], ], }, { 'job_name': 'gitlab-nginx', 'static_configs' => [ 'targets' => ['1.1.1.4:8060', '1.1.1.5:8060'], ], }, { 'job_name': 'gitlab-workhorse', 'static_configs' => [ 'targets' => ['1.1.1.4:9229', '1.1.1.5:9229'], ], }, { 'job_name': 'gitlab-rails', 'metrics_path': '/-/metrics', 'static_configs' => [ 'targets' => ['1.1.1.4:8080', '1.1.1.5:8080'], ], }, { 'job_name': 'gitlab-sidekiq', 'static_configs' => [ 'targets' => ['1.1.1.4:8082', '1.1.1.5:8082'], ], }, { 'job_name': 'node', 'static_configs' => [ 'targets' => ['1.1.1.1:9100', '1.1.1.2:9100', '1.1.1.3:9100', '1.1.1.4:9100', '1.1.1.5:9100'], ], }, ] ``` 5. 保存文件并[重新配置 GitLab](../restart_gitlab.html#omnibus-gitlab-reconfigure) . 6. 在 GitLab 用戶界面中,將`admin/application_settings/metrics_and_profiling` >指標-Grafana 設置為`/-/grafana`到`http[s]://<MONITOR NODE>/-/grafana` [Back to setup components](#setup-components) ## Configure the object storage[](#configure-the-object-storage "Permalink") GitLab 支持使用對象存儲服務來保存多種類型的數據,建議在[NFS 上使用](#configure-nfs-optional) . 通常,對象存儲服務更適合較大的環境,因為對象存儲通常具有更高的性能,可靠性和可伸縮性. GitLab 已測試或了解客戶使用的對象存儲選項包括: * SaaS / Cloud 解決方案(例如[Amazon S3](https://aws.amazon.com/s3/)或[Google Cloud Storage](https://cloud.google.com/storage) ). * 來自各種存儲供應商的本地硬件和設備. * MinIO( [部署指南](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) ). 要將 GitLab 配置為使用對象存儲,請根據要使用的功能參考以下指南: 1. [Object storage for backups](../../raketasks/backup_restore.html#uploading-backups-to-a-remote-cloud-storage). 2. [Object storage for job artifacts](../job_artifacts.html#using-object-storage) including [incremental logging](../job_logs.html#new-incremental-logging-architecture). 3. [Object storage for LFS objects](../lfs/index.html#storing-lfs-objects-in-remote-object-storage). 4. [Object storage for uploads](../uploads.html#using-object-storage-core-only). 5. [Object storage for merge request diffs](../merge_request_diffs.html#using-object-storage). 6. [容器注冊表的對象存儲](../packages/container_registry.html#use-object-storage) (可選功能). 7. [Mattermost 的對象存儲](https://docs.mattermost.com/administration/config-settings.html#file-storage) (可選功能). 8. [包的對象存儲](../packages/index.html#using-object-storage) (可選功能). 9. [依賴代理的對象存儲](../packages/dependency_proxy.html#using-object-storage) (可選功能). 10. [Pseudonymizer 的對象存儲](../pseudonymizer.html#configuration) (可選功能). 11. [用于自動縮放 Runner 緩存的對象存儲](https://docs.gitlab.com/runner/configuration/autoscale.html) (可選,以提高性能). 12. [Object storage for Terraform state files](../terraform_state.html#using-object-storage-core-only). 對于 GitLab,建議為每種數據類型使用單獨的存儲桶. 我們的配置的局限性是對象存儲的每次使用都是單獨配置的. 我們有一個[問題](https://gitlab.com/gitlab-org/gitlab/-/issues/23345)需要改進,那就是允許一個存儲桶具有單獨的文件夾. 在通過 Helm 圖表部署 GitLab 時使用單個存儲桶會導致從備份還原[無法正常運行](https://docs.gitlab.com/charts/advanced/external-object-storage/) . 盡管您可能暫時不使用 Helm 部署,但是如果稍后將 GitLab 遷移到 Helm 部署,GitLab 仍然可以工作,但是您可能不會意識到備份無法正常工作,直到遇到對備份起作用的關鍵要求. [Back to setup components](#setup-components) ## Configure NFS (optional)[](#configure-nfs-optional "Permalink") 為了提高性能,建議盡可能使用[對象存儲](#configure-the-object-storage)以及[Gitaly](#configure-gitaly) ,而不是使用 NFS. 但是,如果您打算使用 GitLab 頁面,則[必須使用 NFS](troubleshooting.html#gitlab-pages-requires-nfs) . 有關配置 NFS 的信息,請參閱[NFS 文檔頁面](../high_availability/nfs.html) . [Back to setup components](#setup-components) ## Troubleshooting[](#troubleshooting "Permalink") 請參閱[故障排除文檔](troubleshooting.html) . [Back to setup components](#setup-components)
                  <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>

                              哎呀哎呀视频在线观看