<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 功能強大 支持多語言、二開方便! 廣告
                # Configuring GitLab application (Rails) > 原文:[https://docs.gitlab.com/ee/administration/high_availability/gitlab.html](https://docs.gitlab.com/ee/administration/high_availability/gitlab.html) * [First GitLab application server](#first-gitlab-application-server) * [Extra configuration for additional GitLab application servers](#extra-configuration-for-additional-gitlab-application-servers) * [Enable Monitoring](#enable-monitoring) * [Troubleshooting](#troubleshooting) * [Upgrading GitLab HA](#upgrading-gitlab-ha) # Configuring GitLab application (Rails)[](#configuring-gitlab-application-rails "Permalink") 本節介紹如何配置 GitLab 應用程序(Rails)組件. **注意:**底部附近還有一些其他配置,用于其他 GitLab 應用程序服務器. 在繼續安裝 GitLab 之前,閱讀并理解這些其他步驟非常重要.**注意:**建議盡可能通過[NFS](nfs.html)使用[Gitaly 的](gitaly.html) [Cloud Object Storage 服務](object_storage.html) ,以提高性能. 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 文檔](nfs.html#nfs-client-mount-options) . 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 ``` 4. 使用[GitLab 下載中的](https://about.gitlab.com/install/) **步驟 1 和 2**下載/安裝 Omnibus GitLab. 不要完成下載頁面上的其他步驟. 5. 創建/編輯`/etc/gitlab/gitlab.rb`并使用以下配置. 確保更改`external_url`以匹配最終的 GitLab 前端 URL. 根據您的 NFS 配置,您可能需要更改某些 GitLab 數據位置. 有關各種情況的`/etc/gitlab/gitlab.rb`配置值,請參見[NFS 文檔](nfs.html) . 下面的示例假定您已在默認數據位置中添加了 NFS 掛載. 此外,給出的 UID 和 GID 只是示例,您應該使用首選值進行配置. ``` external_url 'https://gitlab.example.com' # Prevent GitLab from starting if NFS data mounts are not available high_availability['mountpoint'] = '/var/opt/gitlab/git-data' # Disable components that will not be on the GitLab application server roles ['application_role'] 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' # 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 ``` 6. [Enable monitoring](#enable-monitoring) **注意:**為了保持 HA 群集之間鏈接的統一性,第一個應用程序服務器上的`external_url`以及其他應用程序服務器應指向用戶將用來訪問 GitLab 的外部 URL. 在典型的 HA 設置中,這將是負載平衡器的 URL,它將把流量路由到 HA 群集中的所有 GitLab 應用程序服務器.**注意:**如上例所示,當在`external_url`指定`https`時,GitLab 會假定您在`/etc/gitlab/ssl/`具有 SSL 證書. 如果沒有證書,NGINX 將無法啟動. 有關更多信息,請參見[NGINX 文檔](https://docs.gitlab.com/omnibus/settings/nginx.html) .**注意:**最好在初始重新配置 GitLab 之前設置`uid`和`gid` . 如果在初始重新配置后設置,Omnibus 將不會遞歸`chown`目錄. ## First GitLab application server[](#first-gitlab-application-server "Permalink") 在第一臺應用程序服務器上,運行: ``` sudo gitlab-ctl reconfigure ``` 這應該編譯配置并初始化數據庫. 在下一步之前,不要在其他應用程序服務器上運行此命令. ## Extra configuration for additional GitLab application servers[](#extra-configuration-for-additional-gitlab-application-servers "Permalink") 其他的 GitLab 服務器( **在**第一個 GitLab 服務器**之后**配置的服務器)需要一些額外的配置. 1. 配置共享機密. 這些值可以從`/etc/gitlab/gitlab-secrets.json`的主要 GitLab 服務器`/etc/gitlab/gitlab-secrets.json` . **在**運行上述步驟中的第一次`reconfigure` **之前,**將此文件復制到輔助服務器. ``` gitlab_shell['secret_token'] = 'fbfb19c355066a9afb030992231c4a363357f77345edd0f2e772359e5be59b02538e1fa6cae8f93f7d23355341cea2b93600dab6d6c3edcdced558fc6d739860' gitlab_rails['otp_key_base'] = 'b719fe119132c7810908bba18315259ed12888d4f5ee5430c42a776d840a396799b0a5ef0a801348c8a357f07aa72bbd58e25a84b8f247a25c72f539c7a6c5fa' gitlab_rails['secret_key_base'] = '6e657410d57c71b4fc3ed0d694e7842b1895a8b401d812c17fe61caf95b48a6d703cb53c112bc01ebd197a85da81b18e29682040e99b4f26594772a4a2c98c6d' gitlab_rails['db_key_base'] = 'bf2e47b68d6cafaef1d767e628b619365becf27571e10f196f98dc85e7771042b9203199d39aff91fcb6837c8ed83f2a912b278da50999bb11a2fbc0fba52964' ``` 2. 運行`touch /etc/gitlab/skip-auto-reconfigure`以防止數據庫遷移在升級時運行. 只有主 GitLab 應用程序服務器才能處理遷移. 3. **推薦**配置主機密鑰. 將主應用程序服務器上`/etc/ssh/`的內容(私鑰和公鑰)復制到所有輔助服務器上的`/etc/ssh` . 這樣可以防止訪問負載平衡器后面的高可用性群集中的服務器時出現虛假的中間人攻擊警報. 4. 運行`sudo gitlab-ctl reconfigure`來編譯配置. **注意:**發生更新并執行數據庫遷移后,您將需要重新啟動 GitLab 應用程序節點. ## Enable Monitoring[](#enable-monitoring "Permalink") 在 GitLab 12.0 中[引入](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/3786) . 如果啟用了監視,則必須在**所有** GitLab 服務器上將其啟用. 1. Make sure to collect [`CONSUL_SERVER_NODES`](../postgresql/replication_and_failover.html#consul-information), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z` 2. 創建/編輯`/etc/gitlab/gitlab.rb`并添加以下配置: ``` # Enable service discovery for Prometheus consul['enable'] = true consul['monitoring_service_discovery'] = true # Replace placeholders # Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z # with the addresses of the Consul server nodes consul['configuration'] = { retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z), } # Set the network addresses that the exporters 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 list that allows it to # scrape the NGINX metrics. Replace placeholder `monitoring.gitlab.example.com` with # the address and/or subnets gathered from the monitoring node(s). gitlab_rails['monitoring_whitelist'] = ['monitoring.gitlab.example.com', '127.0.0.0/8'] nginx['status']['options']['allow'] = ['monitoring.gitlab.example.com', '127.0.0.0/8'] ``` 3. 運行`sudo gitlab-ctl reconfigure`來編譯配置. **警告:**如果運行 Unicorn,則在`gitlab.rb`更改`unicorn['listen']`并運行`sudo gitlab-ctl reconfigure`后,收到`HUP`后,Unicorn 可能需要較長的時間才能完成重新加載. 有關更多信息,請參見[問題](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4401) . ## Troubleshooting[](#troubleshooting "Permalink") * `mount: wrong fs type, bad option, bad superblock on` 您尚未安裝必要的 NFS 客戶端實用程序. 請參閱上面的步驟 1. * `mount: mount point /var/opt/gitlab/... does not exist` NFS 服務器上不存在此特定目錄. 確保共享已導出并且存在于 NFS 服務器上,然后嘗試重新安裝. * * * ## Upgrading GitLab HA[](#upgrading-gitlab-ha "Permalink") 可以在不停機的情況下升級 GitLab HA 安裝,但是必須仔細協調升級過程,以免發生故障. 有關更多詳細信息,請參見[Omnibus GitLab 多節點升級文檔](https://docs.gitlab.com/omnibus/update/) . 閱讀更多有關高可用性配置的信息: 1. [Configure the database](../postgresql/replication_and_failover.html) 2. [Configure Redis](redis.html) 3. [Configure NFS](nfs.html) 4. [Configure the load balancers](load_balancer.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>

                              哎呀哎呀视频在线观看