[系統部署] Gitlab 常用指令

紀錄Gitlab Server 常用的指令
重製設定
1
gitlab-ctl reconfigure
啟動
1
gitlab-ctl start
關閉
1
gitlab-ctl stop
升級
1
yum update gitlab-ee
手動備份
1
gitlab-rake gitlab:backup:create
要自行手動備份
1
2
3
/etc/gitlab/gitlab.rb         #配置文件須備份
/var/opt/gitlab/nginx/conf #nginx配置文件
/etc/postfix/main.cfpostfix #郵件配置備份
更換備份資料夾[刷新檔案權限為git]
1
2
3
mkdir -p /mnt/gitlab/backups
chown -R git.git /mnt/gitlab/backups
chown -R git.git /mnt/gitlab/backups
還原
1
2
3
4
5
6
7
8
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl status

gitlab-rake gitlab:backup:restore backup=1525801521_gitlab_backup.tar(看檔案名稱)(還原最後一版可以不加這段
gitlab:backup:restore backup=1525801521_gitlab_backup.tar(看檔案名稱)

gitlab-ctl start

502錯誤排解

1
2
3
4
5
vi /etc/gitlab/gitlab.rb
.
.
.
unicorn['port'] = 9090(更換端口)