Skip to content
代码片段 群组 项目
提交 b39a958d 编辑于 作者: James Fargher's avatar James Fargher
浏览文件

Merge branch 'docs/bprescott/20221111-gitaly' into 'master'

Gitaly doc revisions - network time, praefect replica paths, GC server hooks

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103813



Merged-by: default avatarJames Fargher <proglottis@gmail.com>
Approved-by: default avatarChristian Couder <chriscool@tuxfamily.org>
Approved-by: default avatarJames Fargher <proglottis@gmail.com>
Co-authored-by: default avatarEvan Read <eread@gitlab.com>
Co-authored-by: default avatarBen Prescott <bprescott@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -47,15 +47,30 @@ To create server hooks for a repository: ...@@ -47,15 +47,30 @@ To create server hooks for a repository:
`pre-receive` server hook, the filename should be `pre-receive` with no extension. `pre-receive` server hook, the filename should be `pre-receive` with no extension.
- To create many server hooks, create a directory for the hooks that matches the hook type. For example, for a - To create many server hooks, create a directory for the hooks that matches the hook type. For example, for a
`pre-receive` server hook, the directory name should be `pre-receive.d`. Put the files for the hook in that directory. `pre-receive` server hook, the directory name should be `pre-receive.d`. Put the files for the hook in that directory.
1. Make the server hook files executable and ensure that they are owned by the Git user. 1. **Make the server hook files executable** and ensure that they are owned by the Git user.
1. Write the code to make the server hook function as expected. Git server hooks can be in any programming language. Ensure 1. Write the code to make the server hook function as expected. Git server hooks can be in any programming language. Ensure
the [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) at the top reflects the language type. For the [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) at the top reflects the language type. For
example, if the script is in Ruby the shebang is probably `#!/usr/bin/env ruby`. example, if the script is in Ruby the shebang is probably `#!/usr/bin/env ruby`.
1. Make the hook file executable, ensure that it's owned by the Git user, and ensure it does not match the backup file 1. Ensure the hook file does not match the backup file
pattern (`*~`). pattern (`*~`).
If the server hook code is properly implemented, it should execute when the Git hook is next triggered. If the server hook code is properly implemented, it should execute when the Git hook is next triggered.
### Gitaly Cluster
If you use [Gitaly Cluster](gitaly/index.md), the scripts must be copied to every Gitaly node that has a replica of the repository. Every Gitaly node
needs a copy because any node can be made a primary at any time. Server hooks only run on primary nodes.
The location to copy the scripts to depends on where repositories are stored:
- In GitLab 15.2 and earlier, Gitaly Cluster uses the [hashed storage path](repository_storage_types.md#hashed-storage)
reported by the GitLab application.
- In GitLab 15.3 and later, new repositories are created using
[Praefect-generated replica paths](gitaly/index.md#praefect-generated-replica-paths-gitlab-150-and-later),
which are not the hashed storage path. The replica path can be identified by
[querying the Praefect repository metadata](../administration/gitaly/troubleshooting.md#view-repository-metadata)
using `-relative-path` to specify the expected GitLab hashed storage path.
## Create global server hooks for all repositories ## Create global server hooks for all repositories
To create a Git hook that applies to all repositories, set a global server hook. Global server hooks also apply to: To create a Git hook that applies to all repositories, set a global server hook. Global server hooks also apply to:
......
...@@ -205,3 +205,13 @@ users are on the most up-to-date instances of GitLab. These two services can be ...@@ -205,3 +205,13 @@ users are on the most up-to-date instances of GitLab. These two services can be
environments so that they do not attempt and fail to reach out to GitLab services. environments so that they do not attempt and fail to reach out to GitLab services.
Learn more about [disabling usage statistics](../../user/admin_area/settings/usage_statistics.md#enable-or-disable-usage-statistics). Learn more about [disabling usage statistics](../../user/admin_area/settings/usage_statistics.md#enable-or-disable-usage-statistics).
### Configure NTP
In GitLab 15.4 and 15.5, Gitaly Cluster doesn't function if `pool.ntp.org` is unreachable.
[Customize the time server setting](../../administration/gitaly/praefect.md#customize-time-server-setting) on the Gitaly
and Praefect servers so they can use an accessible NTP server.
On offline instances, the [GitLab Geo check Rake task](../../administration/geo/replication/troubleshooting.md#can-geo-detect-the-current-site-correctly)
always fails because it uses `pool.ntp.org`. This error can be ignored but you can
[read more about how to work around it](../../administration/geo/replication/troubleshooting.md#message-machine-clock-is-synchronized--exception).
...@@ -506,6 +506,8 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap ...@@ -506,6 +506,8 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
sidekiq['routing_rules'] = [['*', 'default']] sidekiq['routing_rules'] = [['*', 'default']]
``` ```
- New Git repositories created in Gitaly cluster [no longer use the `@hashed` storage path](#change-to-praefect-generated-replica-paths-in-gitlab-153). Server
hooks for new repositories must be copied into a different location.
- The structure of `/etc/gitlab/gitlab-secrets.json` was modified in [GitLab 15.4](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6310), - The structure of `/etc/gitlab/gitlab-secrets.json` was modified in [GitLab 15.4](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6310),
and new configuration was added to `gitlab_pages`, `grafana`, and `mattermost` sections. and new configuration was added to `gitlab_pages`, `grafana`, and `mattermost` sections.
In a highly available or GitLab Geo environment, secrets need to be the same on all nodes. In a highly available or GitLab Geo environment, secrets need to be the same on all nodes.
...@@ -521,6 +523,8 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap ...@@ -521,6 +523,8 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
- [Incorrect deletion of object storage files on Geo secondary sites](https://gitlab.com/gitlab-org/gitlab/-/issues/371397) can occur in certain situations. See [Geo: Incorrect object storage LFS file deletion on secondary site issue in GitLab 15.0.0 to 15.3.2](#geo-incorrect-object-storage-lfs-file-deletion-on-secondary-sites-in-gitlab-1500-to-1532). - [Incorrect deletion of object storage files on Geo secondary sites](https://gitlab.com/gitlab-org/gitlab/-/issues/371397) can occur in certain situations. See [Geo: Incorrect object storage LFS file deletion on secondary site issue in GitLab 15.0.0 to 15.3.2](#geo-incorrect-object-storage-lfs-file-deletion-on-secondary-sites-in-gitlab-1500-to-1532).
- LFS transfers can [redirect to the primary from secondary site mid-session](https://gitlab.com/gitlab-org/gitlab/-/issues/371571) causing failed pull and clone requests when [Geo proxying](../administration/geo/secondary_proxy/index.md) is enabled. Geo proxying is enabled by default in GitLab 15.1 and later. See [Geo: LFS transfer redirect to primary from secondary site mid-session issue in GitLab 15.1.0 to 15.3.2](#geo-lfs-transfers-redirect-to-primary-from-secondary-site-mid-session-in-gitlab-1510-to-1532) for more details. - LFS transfers can [redirect to the primary from secondary site mid-session](https://gitlab.com/gitlab-org/gitlab/-/issues/371571) causing failed pull and clone requests when [Geo proxying](../administration/geo/secondary_proxy/index.md) is enabled. Geo proxying is enabled by default in GitLab 15.1 and later. See [Geo: LFS transfer redirect to primary from secondary site mid-session issue in GitLab 15.1.0 to 15.3.2](#geo-lfs-transfers-redirect-to-primary-from-secondary-site-mid-session-in-gitlab-1510-to-1532) for more details.
- New Git repositories created in Gitaly cluster [no longer use the `@hashed` storage path](#change-to-praefect-generated-replica-paths-in-gitlab-153). Server
hooks for new repositories must be copied into a different location.
### 15.2.0 ### 15.2.0
...@@ -1197,6 +1201,19 @@ After upgraded to 11.11.8 you can safely upgrade to 12.0.Z. ...@@ -1197,6 +1201,19 @@ After upgraded to 11.11.8 you can safely upgrade to 12.0.Z.
See our [documentation on upgrade paths](../policy/maintenance.md#upgrade-recommendations) See our [documentation on upgrade paths](../policy/maintenance.md#upgrade-recommendations)
for more information. for more information.
### Change to Praefect-generated replica paths in GitLab 15.3
New Git repositories created in Gitaly cluster no longer use the `@hashed` storage path.
Praefect now generates replica paths for use by Gitaly cluster.
This change is a pre-requisite for Gitaly cluster atomically creating, deleting, and
renaming Git repositories.
To identify the replica path, [query the Praefect repository metadata](../administration/gitaly/troubleshooting.md#view-repository-metadata)
and pass the `@hashed` storage path to `-relative-path`.
With this information, you can correctly install [server hooks](../administration/server_hooks.md).
### Maintenance mode issue in GitLab 13.9 to 14.4 ### Maintenance mode issue in GitLab 13.9 to 14.4
When [Maintenance mode](../administration/maintenance_mode/index.md) is enabled, users cannot sign in with SSO, SAML, or LDAP. When [Maintenance mode](../administration/maintenance_mode/index.md) is enabled, users cannot sign in with SSO, SAML, or LDAP.
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册