<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Maintenance Rake tasks > 原文:[https://docs.gitlab.com/ee/administration/raketasks/maintenance.html](https://docs.gitlab.com/ee/administration/raketasks/maintenance.html) * [Gather GitLab and system information](#gather-gitlab-and-system-information) * [Show GitLab license information](#show-gitlab-license-information-starter-only) * [Check GitLab configuration](#check-gitlab-configuration) * [Rebuild authorized_keys file](#rebuild-authorized_keys-file) * [Clear Redis cache](#clear-redis-cache) * [Precompile the assets](#precompile-the-assets) * [Check TCP connectivity to a remote site](#check-tcp-connectivity-to-a-remote-site) * [Clear exclusive lease (DANGER)](#clear-exclusive-lease-danger) * [Display status of database migrations](#display-status-of-database-migrations) * [Run incomplete database migrations](#run-incomplete-database-migrations) * [Import common metrics](#import-common-metrics) # Maintenance Rake tasks[](#maintenance-rake-tasks-core-only "Permalink") GitLab 提供 Rake 任務進行常規維護. ## Gather GitLab and system information[](#gather-gitlab-and-system-information "Permalink") 該命令收集有關您的 GitLab 安裝及其運行系統的信息. 這些在尋求幫助或報告問題時可能很有用. **全部安裝** ``` sudo gitlab-rake gitlab:env:info ``` **源安裝** ``` bundle exec rake gitlab:env:info RAILS_ENV=production ``` 輸出示例: ``` System information System: Debian 7.8 Current User: git Using RVM: no Ruby Version: 2.1.5p273 Gem Version: 2.4.3 Bundler Version: 1.7.6 Rake Version: 10.3.2 Redis Version: 3.2.5 Sidekiq Version: 2.17.8 GitLab information Version: 7.7.1 Revision: 41ab9e1 Directory: /home/git/gitlab DB Adapter: postgresql URL: https://gitlab.example.com HTTP Clone URL: https://gitlab.example.com/some-project.git SSH Clone URL: git@gitlab.example.com:some-project.git Using LDAP: no Using Omniauth: no GitLab Shell Version: 2.4.1 Repositories: /home/git/repositories/ Hooks: /home/git/gitlab-shell/hooks/ Git: /usr/bin/git ``` ## Show GitLab license information[](#show-gitlab-license-information-starter-only "Permalink") 在 GitLab Starter 12.6 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20501) . 該命令顯示有關您的[GitLab 許可證](../../user/admin_area/license.html)以及使用了多少個席位的信息. 它僅在 GitLab Enterprise 安裝中可用:許可證無法安裝到 GitLab Community Edition 中. 當通過支持人員舉票或以編程方式檢查許可證參數時,這些選項可能很有用. **全部安裝** ``` sudo gitlab-rake gitlab:license:info ``` **源安裝** ``` bundle exec rake gitlab:license:info RAILS_ENV=production ``` 輸出示例: ``` Today's Date: 2020-02-29 Current User Count: 30 Max Historical Count: 30 Max Users in License: 40 License valid from: 2019-11-29 to 2020-11-28 Email associated with license: user@example.com ``` ## Check GitLab configuration[](#check-gitlab-configuration "Permalink") `gitlab:check` Rake 任務運行以下 Rake 任務: * `gitlab:gitlab_shell:check` * `gitlab:gitaly:check` * `gitlab:sidekiq:check` * `gitlab:app:check` 它將檢查是否已根據安裝指南設置了每個組件,并針對發現的問題提出了修復建議. 此命令必須從您的應用程序服務器運行,并且在[Gitaly 之](../gitaly/index.html#run-gitaly-on-its-own-server)類的組件服務器上將無法正常運行. 您還可以查看我們的故障排除指南,以了解: * [GitLab](../index.html#troubleshooting) * [Omnibus GitLab](https://docs.gitlab.com/omnibus/README.html) 要運行`gitlab:check` ,請運行: **全部安裝** ``` sudo gitlab-rake gitlab:check ``` **源安裝** ``` bundle exec rake gitlab:check RAILS_ENV=production ``` **注意:**對`gitlab:check`使用`SANITIZE=true` `gitlab:check`是否要從輸出中省略項目名稱. 輸出示例: ``` Checking Environment ... Git configured for git user? ... yes Has python2? ... yes python2 is supported version? ... yes Checking Environment ... Finished Checking GitLab Shell ... GitLab Shell version? ... OK (1.2.0) Repo base directory exists? ... yes Repo base directory is a symlink? ... no Repo base owned by git:git? ... yes Repo base access is drwxrws---? ... yes post-receive hook up-to-date? ... yes post-receive hooks in repos are links: ... yes Checking GitLab Shell ... Finished Checking Sidekiq ... Running? ... yes Checking Sidekiq ... Finished Checking GitLab ... Database config exists? ... yes Database is SQLite ... no All migrations up? ... yes GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Init script exists? ... yes Init script up-to-date? ... yes Redis version >= 2.0.0? ... yes Checking GitLab ... Finished ``` ## Rebuild authorized_keys file[](#rebuild-authorized_keys-file "Permalink") 在某些情況下,有必要重建`authorized_keys`文件. 為此,請運行: **全部安裝** ``` sudo gitlab-rake gitlab:shell:setup ``` **源安裝** ``` cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production ``` 輸出示例: ``` This will rebuild an authorized_keys file. You will lose any data stored in authorized_keys file. Do you want to continue (yes/no)? yes ``` ## Clear Redis cache[](#clear-redis-cache "Permalink") 如果出于某種原因,儀表板顯示了錯誤的信息,則可能需要清除 Redis 的緩存. 為此,請運行: **全部安裝** ``` sudo gitlab-rake cache:clear ``` **源安裝** ``` cd /home/git/gitlab sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production ``` ## Precompile the assets[](#precompile-the-assets "Permalink") 有時,在版本升級期間,您可能會遇到一些錯誤的 CSS 或缺少某些圖標的情況. 在這種情況下,請嘗試再次重新編譯資產. 這僅適用于源安裝,不適用于 Omnibus 軟件包. **源安裝** ``` cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:assets:compile RAILS_ENV=production ``` 對于多功能版本,未優化的資產(JavaScript,CSS)在上游 GitLab 發行時被凍結. 多功能版本包括這些資產的優化版本. 除非在安裝軟件包之后在生產機器上修改 JavaScript / CSS 代碼,否則應該沒有理由在生產機器上重做`rake gitlab:assets:compile` . 如果您懷疑資產已損壞,則應重新安裝 omnibus 軟件包. ## Check TCP connectivity to a remote site[](#check-tcp-connectivity-to-a-remote-site "Permalink") 有時您需要知道您的 GitLab 安裝是否可以連接到另一臺機器上的 TCP 服務-也許是 PostgreSQL 或 HTTPS 服務器. 包含一個 Rake 任務可以幫助您: **全部安裝** ``` sudo gitlab-rake gitlab:tcp_check[example.com,80] ``` **源安裝** ``` cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:tcp_check[example.com,80] RAILS_ENV=production ``` ## Clear exclusive lease (DANGER)[](#clear-exclusive-lease-danger "Permalink") GitLab 使用共享鎖機制: `ExclusiveLease`防止共享資源中的同時操作. 一個示例是在存儲庫上運行定期垃圾收集. 在非常特殊的情況下,如果不釋放鎖定,則由專有租賃鎖定的操作可能會失敗. 如果您不能等待它過期,可以運行此任務以手動清除它. 要清除所有專有租賃: **危險:**請勿在 GitLab 或 Sidekiq 運行時運行它 ``` sudo gitlab-rake gitlab:exclusive_lease:clear ``` 要指定租約`type`或租約`type + id` ,請指定范圍: ``` # to clear all leases for repository garbage collection: sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:*] # to clear a lease for repository garbage collection in a specific project: (id=4) sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:4] ``` ## Display status of database migrations[](#display-status-of-database-migrations "Permalink") 請參閱[升級文檔](../../update/README.html#checking-for-background-migrations-before-upgrading) ,以了解在升級 GitLab 時如何檢查遷移是否完成. 要檢查特定遷移的狀態,可以使用以下 Rake 任務: ``` sudo gitlab-rake db:migrate:status ``` 這將為每個遷移 ID 輸出一個`Status`為`up`或`down`的表. ``` database: gitlabhq_production Status Migration ID Migration Name -------------------------------------------------- up migration_id migration_name ``` ## Run incomplete database migrations[](#run-incomplete-database-migrations "Permalink") 數據庫遷移可能會停留在不完整的狀態. 也就是說,它們在`sudo gitlab-rake db:migrate:status`命令的輸出中將處于`down`狀態. 要完成這些遷移,請使用以下 Rake 任務: ``` sudo gitlab-rake db:migrate ``` 命令完成后,運行`sudo gitlab-rake db:migrate:status`來檢查是否所有遷移都已完成(具有`up`狀態). ## Import common metrics[](#import-common-metrics "Permalink") 有時,您可能需要重新導入為"指標"儀表板提供動力的通用指標. 這可能是由于[更新現有指標](../../development/prometheus_metrics.html#update-existing-metrics)或作為[故障排除措施的結果](../../operations/metrics/dashboards/index.html#troubleshooting) . 要重新導入指標,可以運行: ``` sudo gitlab-rake metrics:setup_common_metrics ```
                  <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>

                              哎呀哎呀视频在线观看