标签:生效 life 发送 ESS asi 文件 授权 nta 仓库
1.下载gitlab服务端安装包,注意版本wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.6.9-ce.0.el7.x86_64.rpm/download.rpm
2.安装yum仓库
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3.安装gitlab
sudo yum install gitlab-ce-11.6.9-ce.0.el7.x86_64
4.修改external_url地址
vim /etc/gitlab/gitlab.rb
EXTERNAL_URL="https://test.test.com"
5.启动gitlab服务器
gitlab-ctl reconfigure
6.备份gitlab仓库
sudo gitlab-rake gitlab:backup:create
7.设置备份gitlab仓库周期
/etc/gitlab/gitlab.rb
## Limit backup lifetime to 7 days - 604800 seconds
gitlab_rails[‘backup_keep_time‘] = 604800
修改配置后执行重新配置:gitlab-ctl reconfigure
当然也可以设置crontab任务计划进行备份,CRON=1不会输出备份过程中的详细信息
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
8.拷贝备份文件并授权git用户
sudo cp 1564077625_2019_07_26_11.6.9_gitlab_backup.tar /var/opt/gitlab/backups/
sudo chown git.git /var/opt/gitlab/backups/1564077625_2019_07_26_11.6.9_gitlab_backup.tar
9.停止两个进程,停止掉所有数据连接服务,保证数据一致性
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# Verify
sudo gitlab-ctl status
10.还原gitlab数据备份文件,注意backup=后面的要看版本,有些是不需要指定具体的文件全名的,比如1564077625_2019_07_26_11.6.9-ce,或者1564077625_2019_07_26_11.6.9
sudo gitlab-rake gitlab:backup:restore BACKUP=1564077625_2019_07_26_11.6.9
11.重启并确认状态信息
sudo gitlab-ctl restart
sudo gitlab-rake gitlab:check SANITIZE=true
12.如何修改gitlab端口??
vim /etc/gitlab/gitlab.rb
external_url ‘http://test.test.com:8088‘
nginx[‘listen_port‘] = 8088
修改端口后,重启gitlab服务生效
gitlab-ctl reconfigure
gitlab-ctl restart
13.gitlab如何修改时区?
vim /etc/gitlab/gitlab.rb
例子:
gitlab_rails[‘time_zone‘] = ‘Europe/Brussels‘
中国时区
gitlab_rails[‘time_zone‘] = ‘Asia/Shanghai‘
修改时区后,重启gitlab服务生效
gitlab-ctl reconfigure
gitlab-ctl restart
14.如何测试gitlab邮件发送smtp服务是否正常?
登陆gitlab服务器执行
gitlab-rails console
Notify.test_email(‘123456@qq.com‘, ‘Message Subject‘, ‘Message Body‘).deliver_now
标签:生效 life 发送 ESS asi 文件 授权 nta 仓库
原文地址:https://blog.51cto.com/12185273/2447833