GitLab实战十五——Gitlab 11.0.6 升级至 11.4.14

升级步骤

sudo -u git -H git checkout -f 11-4-stable

# Unicorn.rb配置
worker_processes 24
working_directory "/home/git/git" # available in 0.94.0+
listen "/home/git/git/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true
timeout  300
pid "/home/git/git/tmp/pids/unicorn.pid"
stderr_path "/home/git/git/log/unicorn.stderr.log"
stdout_path "/home/git/git/log/unicorn.stdout.log"
preload_app true
check_client_connection false
require_relative "/home/git/git/lib/gitlab/cluster/lifecycle_events"
before_exec do |server|
 Gitlab::Cluster::LifecycleEvents.do_master_restart
end
before_fork do |server, worker|
 Gitlab::Cluster::LifecycleEvents.do_before_fork
 old_pid = "#{server.config[:pid]}.oldbin"
 if old_pid != server.pid
   begin
     sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
     Process.kill(sig, File.read(old_pid).to_i)
   rescue Errno::ENOENT, Errno::ESRCH
   end
 end
end
after_fork do |server, worker|
 Gitlab::Cluster::LifecycleEvents.do_worker_start
end

数据库变更

Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.: CREATE UNIQUE INDEX `index_programming_languages_on_name`  ON `programming_languages` (`name`)

alter table programming_languages modify name varchar(190);

vim /home/git/git/db/migrate/20180531185349_add_repository_languages.rb

Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.: CREATE UNIQUE INDEX `index_protected_tags_on_project_id_and_name`  ON `protected_tags` (`project_id`, `name`)

alter table protected_tags  modify name varchar(190);

Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.: CREATE UNIQUE INDEX `index_prometheus_metrics_on_identifier`  ON `prometheus_metrics` (`identifier`)

alter table prometheus_metrics modify identifier varchar(190);

后端数据库表结构变更共耗时3个半小时,前端xxx
sudo -u git -H bundle exec rake gitlab:sidekiq:check --trace RAILS_ENV=production
sudo -u git -H RAILS_ENV=production bin/background_jobs start
sudo -u git -H RAILS_ENV=production bin/background_jobs killall

升级最好提前把share/artifacts/下项目ci构建的数据拷贝到迁移机器上,不然会在计划任务重建,把sidekiq撑爆,影响打包
已计划
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18615

fatal: destination path '/builds/i18n-server/mi-event' already exists and is not an empty directory.
pipelines点击clear runner caches清除缓存

升级后sidekiq很容易删掉,提示是有bug,需要重装re2
https://gitlab.com/gitlab-org/gitlab-ce/issues/60626

https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting#my-sidekiq-process-is-crashing-what-do-i-do

或者考虑降级
ruby 2.5.0p0 -> ruby 2.4.2p198

gitlab11.4 -> 11.1

https://gitlab.com/gitlab-org/gitlab-ce/issues/54426

/home/git/git/lib/gitlab/untrusted_regexp.rb:23: [BUG] Segmentation fault at 0x00007f6200000000
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]

/home/git/git/lib/gitlab/untrusted_regexp.rb:23: [BUG] Segmentation fault at 0x0000000000000000

Gitlab11.4 Gitlab::Git::CommandError: 13:exit status 128

2019-04-17T11:23:08.531Z 165744 TID-ow5eb1mug WARN: {"context":"Job raised exception","job":{"class":"GitGarbageCollectWorker","args":[1111,"incremental_repack","project_housekeeping:1111","62c4fb99-15b1-40a8-ba52-db22fbb78a1e"],"retry":false,"queue":"git_garbage_collect","jid":"810fecabfc37155a944cfb83","created_at":1555500188.4812088,"enqueued_at":1555500188.481362},"jobstr":"{\"class\":\"GitGarbageCollectWorker\",\"args\":[1111,\"incremental_repack\",\"project_housekeeping:1111\",\"62c4fb99-15b1-40a8-ba52-db22fbb78a1e\"],\"retry\":false,\"queue\":\"git_garbage_collect\",\"jid\":\"810fecabfc37155a944cfb83\",\"created_at\":1555500188.4812088,\"enqueued_at\":1555500188.481362}"}
2019-04-17T11:23:08.532Z 165744 TID-ow5eb1mug WARN: Gitlab::Git::CommandError: 13:exit status 128

ci使用git submodule编译报错:
.gitlab-ci.yml去掉以下配置:
before_script:
 - git submodule sync --recursive
 - git submodule update --init --recursive

(gitlab-runner >1.10+)建议改为:
variables:
 GIT_SUBMODULE_STRATEGY: recursive
https://docs.gitlab.com/ee/ci/git_submodules.html

部分项目merge一直转,也关闭不了,只能新fork,merge报500错误,将mysql 5.5数据库升级成5.7可解决,
也可以提升下机器配置,merge会更快。

https://gitlab.com/gitlab-org/gitlab-ce/issues/41545

ci报错,提示/builds/xxx已存在或不为空
解决:

Go to project Settings->CI/CD->General pipelines settings:
Change Git strategy for pipelines from
git fetch
to
git clone

Retry Build

gitlab sign-in using cas3 auth failed because email is invalid(422)

RuntimeError: Unable to fork project 6854 for repository b2cshopapi/xiaomi_shopapi_new -> i18n-base/xiaomi_shopapi_new

fork-repository failed: 13:CreateFork: clone cmd wait: exit status 128

Project yangmingmao/mishop_comment_service was in inconsistent state (failed) while forking

/home/git/gitaly/config.toml
bin_dir = "/home/git/gitaly"
/etc/init.d/gitlab stop
$ cd ~/gitaly
$ make

$ cd ~/gitlab-shell
$ ./bin/install
$ ./bin/compile
/etc/init.d/gitlab start

https://gitlab.com/gitlab-org/gitlab-ce/issues/48312
https://gitlab.com/gitlab-org/gitlab-runner/blob/master/docs/executors/docker.md#the-builds-and-cache-storage
https://gitlab.com/gitlab-org/gitlab-runner/issues/2669
https://gitlab.com/gitlab-org/gitlab-runner/issues/2960

升级后验证

GitLab实战十五——Gitlab 11.0.6 升级至 11.4.14

anzhihe 安志合个人博客,版权所有 丨 如未注明,均为原创 丨 转载请注明转自:https://chegva.com/3591.html | ☆★★每天进步一点点,加油!★★☆ | 

您可能还感兴趣的文章!

发表评论

电子邮件地址不会被公开。 必填项已用*标注