pages数据存在对象存储中缺少proxy_download配置,导致Geo无法同步这部分对象存储数据
Summary
当把pages数据存放到对象存储之后,通过Geo的同步功能就无法同步pages的数据。经过研究发现:要利用Geo同步对象存储的数据,必须给对应的数据开启proxy_download功能,但是pages目前不支持这个配置,所以就无法完成这部分数据同步。
Steps to reproduce
- 将pages数据存放到对象存储中;
- 配置Geo同步
- 勾选Allow this secondary site to replicate content on Object Storage
Example Project
What is the current bug behavior?
无法通过Geo同步pages的对象存储数据。
What is the expected correct behavior?
Geo能够正常同步pages对象存储数据。
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
修改cookbook:
vim /opt/gitlab/embedded/cookbooks/gitlab/templates/default/gitlab.yml.erb
## GitLab Pages
pages:
enabled: <%= @pages_enabled %>
access_control: <%= @pages_access_control %>
path: <%= @pages_path %>
host: <%= @pages_host %>
port: <%= @pages_port %>
https: <%= @pages_https %>
external_http: <%= !@pages_external_http.empty? %>
external_https: <%= !@pages_external_https.empty? || !@pages_external_https_proxyv2.empty? %>
artifacts_server: <%= @pages_artifacts_server %>
object_store:
enabled: <%= @pages_object_store_enabled %>
proxy_download: <%= @pages_object_store_proxy_download %>
remote_directory: <%= quote(@pages_object_store_remote_directory) %>
connection: <%= @pages_object_store_connection.to_json %>
local_store:
enabled: <%= @pages_local_store_enabled %>
path: <%= @pages_local_store_path %>
其中的object_store.proxy_download这一段是新增的。
编辑gitlab.rb配置文件:
gitlab_rails['pages_object_store_proxy_download'] = true
再执行:
gitlab-ctl reconfigure
之后proxy_download的配置生效,成功解决问题。