<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 功能強大 支持多語言、二開方便! 廣告
                # Gitaly reference > 原文:[https://docs.gitlab.com/ee/administration/gitaly/reference.html](https://docs.gitlab.com/ee/administration/gitaly/reference.html) * [Format](#format) * [Authentication](#authentication) * [TLS](#tls) * [Storage](#storage) * [Git](#git) * [`cat-file` cache](#cat-file-cache) * [`gitaly-ruby`](#gitaly-ruby) * [GitLab Shell](#gitlab-shell) * [Prometheus](#prometheus) * [Logging](#logging) * [Concurrency](#concurrency) # Gitaly reference[](#gitaly-reference "Permalink") 通過[TOML](https://github.com/toml-lang/toml)配置文件配置 Gitaly. 與源安裝不同,在 Omnibus GitLab 中,您不會直接編輯此文件. 配置文件作為參數傳遞給`gitaly`可執行文件. 通常由 Omnibus GitLab 或您的[init](https://en.wikipedia.org/wiki/Init)腳本完成. 可以在 Gitaly 項目中找到[示例配置文件](https://gitlab.com/gitlab-org/gitaly/blob/master/config.toml.example) . ## Format[](#format "Permalink") 在頂層, `config.toml`定義下表中描述的項目. | Name | Type | Required | Description | | --- | --- | --- | --- | | `socket_path` | string | 是(如果未設置`listen_addr` ) | Gitaly 應該打開 Unix 套接字的路徑. | | `listen_addr` | string | 是(如果未設置`socket_path` ) | Gitaly 偵聽的 TCP 地址. | | `tls_listen_addr` | string | no | TCP over TLS 地址供 Gitaly 偵聽. | | `bin_dir` | string | yes | 包含 Gitaly 可執行文件的目錄. | | `prometheus_listen_addr` | string | no | Prometheus 指標的 TCP 偵聽地址. 如果未設置,則不會啟動 Prometheus 偵聽器. | 例如: ``` socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket" listen_addr = "localhost:9999" tls_listen_addr = "localhost:8888" bin_dir = "/home/git/gitaly" prometheus_listen_addr = "localhost:9236" ``` ### Authentication[](#authentication "Permalink") 可以將 Gitaly 配置為拒絕標頭中不包含特定承載令牌的請求. 這是通過 TCP 服務請求時要使用的一種安全措施: ``` [auth] # A non-empty token enables authentication. token = "the secret token" ``` 當`config.toml`的令牌設置不存在或為空字符串時,將禁用身份驗證. 可以使用`transitioning`設置暫時禁用身份驗證. 這使您可以監視所有客戶端是否都在正確認證,而不會導致尚未正確配置的客戶端的服務中斷: ``` [auth] token = "the secret token" transitioning = true ``` **警告:**完成更改令牌設置后,切記禁用`transitioning` . 所有身份驗證嘗試均以`gitaly_authentications_total`指標在 Prometheus 中進行計數. ### TLS[](#tls "Permalink") Gitaly 支持 TLS 加密. 您將需要攜帶自己的證書,因為該證書不會自動提供. | Name | Type | Required | Description | | --- | --- | --- | --- | | `certificate_path` | string | no | 證書的路徑. | | `key_path` | string | no | 密鑰的路徑. | ``` tls_listen_addr = "localhost:8888" [tls] certificate_path = '/home/git/cert.cert' key_path = '/home/git/key.pem' ``` 在 Gitaly 中[了解](index.html#enable-tls-support)有關 TLS 的[更多](index.html#enable-tls-support)信息. ### Storage[](#storage "Permalink") GitLab 存儲庫被分組到稱為"存儲"的目錄中(例如`/home/git/repositories` ),其中包含由 GitLab 管理的裸存儲庫,其名稱(例如`default` ). 這些名稱和路徑也在 GitLab 的`gitlab.yml`配置文件中定義. 當你在同一臺機器 GitLab,這是默認和推薦的配置上運行 Gitaly,在 Gitaly 的定義存儲路徑`config.toml`必須與在`gitlab.yml` . | Name | Type | Required | Description | | --- | --- | --- | --- | | `storage` | array | yes | 一組存儲分片. | | `path` | string | yes | 存儲分片的路徑. | | `name` | string | yes | 存儲分片的名稱. | 例如: ``` [[storage]] path = "/path/to/storage/repositories" name = "my_shard" [[storage]] path = "/path/to/other/repositories" name = "other_storage" ``` ### Git[](#git "Permalink") 可以在配置文件的`[git]`部分中設置以下值. | Name | Type | Required | Description | | --- | --- | --- | --- | | `bin_path` | string | no | Git 二進制文件的路徑. 如果未設置,將使用`PATH`進行解析. | | `catfile_cache_size` | integer | no | 緩存的[cat 文件進程的](#cat-file-cache)最大數量. 默認值為`100` . | #### `cat-file` cache[](#cat-file-cache "Permalink") 許多 Gitaly RPC 需要從存儲庫中查找 Git 對象. 大多數時候,我們使用`git cat-file --batch`進程. 為了獲得更好的性能,Gitaly 可以在 RPC 調用之間重用這些`git cat-file`過程. 先前使用的進程保留在[" Git cat-file 緩存"中](https://about.gitlab.com/blog/2019/07/08/git-performance-on-nfs/#enter-cat-file-cache) . 為了控制其使用多少系統資源,我們擁有可進入高速緩存的 cat 文件進程的最大數量. 默認限制是 100 個`cat-file` ,它們構成了一對`git cat-file --batch`和`git cat-file --batch-check`進程. 如果您看到抱怨"打開的文件太多"或無法創建新進程的錯誤,則可以降低此限制. 理想情況下,該數量應該足夠大以處理正常流量. 如果提高該限制,則應在前后測量緩存命中率. 如果命中率沒有提高,則上限可能不會產生有意義的變化. 這是一個 Prometheus 查詢示例,用于查看命中率: ``` sum(rate(gitaly_catfile_cache_total{type="hit"}[5m])) / sum(rate(gitaly_catfile_cache_total{type=~"(hit)|(miss)"}[5m])) ``` ### `gitaly-ruby`[](#gitaly-ruby "Permalink") 一個 Gitaly 進程使用一個或多個`gitaly-ruby`幫助程序進程來執行在 Ruby 中而非 Go 中實現的 RPC. 配置文件的`[gitaly-ruby]`部分包含這些幫助程序的設置. 已知這些進程有時會遭受內存泄漏. 當其內存超過`max_rss`限制時,Gitaly 將重新啟動其`gitaly-ruby`幫助`max_rss` . | Name | Type | Required | Description | | --- | --- | --- | --- | | `dir` | string | yes | 安裝`gitaly-ruby`路徑(需要引導該進程). | | `max_rss` | integer | no | 觸發`gitaly-ruby`重新啟動的駐留集大小限制(以字節為單位). 默認值為`200000000` (200MB). | | `graceful_restart_timeout` | string | no | 超出`max_rss`后,強制執行`gitaly-ruby`進程之前的`max_rss` . 默認值為`10m` (10 分鐘). | | `restart_delay` | string | no | 重新啟動之前, `gitaly-ruby`內存必須保持高電平的時間. 默認值為`5m` (5 分鐘). | | `num_workers` | integer | no | Number of `gitaly-ruby` worker processes. Try increasing this number in case of `ResourceExhausted` errors. Default is `2`, minimum is `2`. | | `linguist_languages_path` | string | no | 動態`languages.json` .json 發現的替代. 默認為空字符串(使用動態發現). | Example: ``` [gitaly-ruby] dir = "/home/git/gitaly/ruby" max_rss = 200000000 graceful_restart_timeout = "10m" restart_delay = "5m" num_workers = 2 ``` ### GitLab Shell[](#gitlab-shell "Permalink") 出于歷史原因, [GitLab Shell](https://gitlab.com/gitlab-org/gitlab-shell)包含 Git 掛鉤,這些掛鉤允許 GitLab 驗證并響應 Git 推送. 由于 Gitaly 擁有 Git 推送,因此必須在 Gitaly 旁邊安裝 GitLab Shell. 將來會[簡化](https://gitlab.com/gitlab-org/gitaly/-/issues/1226) . | Name | Type | Required | Description | | --- | --- | --- | --- | | `dir` | string | yes | 安裝 GitLab Shell 的目錄. | Example: ``` [gitlab-shell] dir = "/home/git/gitlab-shell" ``` ### Prometheus[](#prometheus "Permalink") 您可以選擇配置 Gitaly 以記錄 Prometheus 中 GRPC 方法調用的直方圖延遲. | Name | Type | Required | Description | | --- | --- | --- | --- | | `grpc_latency_buckets` | array | no | Prometheus 將每個觀察值存儲在一個存儲桶中,這意味著您將獲得延遲的近似值. 優化鏟斗可更好地控制逼近精度. | Example: ``` prometheus_listen_addr = "localhost:9236" [prometheus] grpc_latency_buckets = [0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0, 30.0, 60.0, 300.0, 1500.0] ``` ### Logging[](#logging "Permalink") 以下值在`[logging]`部分下的 Gitaly 中配置日志`[logging]` . | Name | Type | Required | Description | | --- | --- | --- | --- | | `format` | string | no | 日志格式: `text`或`json` . 默認值: `text` . | | `level` | string | no | 日志級別: `debug` , `info` , `warn` , `error` , `fatal`或`panic` . 默認值: `info` . | | `sentry_dsn` | string | no | Sentry DSN 用于異常監視. | | `sentry_environment` | string | no | [Sentry Environment](https://docs.sentry.io/enriching-error-data/environments/)用于異常監視. | | `ruby_sentry_dsn` | string | no | Sentry DSN 用于`gitaly-ruby`異常監視. | While the main Gitaly application logs go to `stdout`, there are some extra log files that go to a configured directory, like the GitLab Shell logs. GitLab Shell does not support `panic` or `trace` level logs. `panic` will fall back to `error`, while `trace` will fall back to `debug`. Any other invalid log levels will default to `info`. Example: ``` [logging] level = "warn" dir = "/home/gitaly/logs" format = "json" sentry_dsn = "https://<key>:<secret>@sentry.io/<project>" ruby_sentry_dsn = "https://<key>:<secret>@sentry.io/<project>" ``` ## Concurrency[](#concurrency "Permalink") 您可以調整每個 RPC 端點的`concurrency`性. | Name | Type | Required | Description | | --- | --- | --- | --- | | `concurrency` | array | yes | RPC 端點數組. | | `rpc` | string | no | RPC 端點的名稱( `/gitaly.RepositoryService/GarbageCollect` ). | | `max_per_repo` | integer | no | 每個存儲庫的每個 RPC 的并發性. | Example: ``` [[concurrency]] rpc = "/gitaly.RepositoryService/GarbageCollect" max_per_repo = 1 ```
                  <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>

                              哎呀哎呀视频在线观看