天天看点

gitlab安装配置、备份恢复

安装前提:内存不少于2G,安装在centos7上

若是此方式不行,就用官网的

1、安装gitlab社区版本,官网的源比较慢,用下面的镜像(清华大学的服务器)

[root@test-7 ~]# vim /etc/yum.repos.d/gitlab.repo

[gitlab-ce]

name=Gitlab CE Repository

gpgcheck=0

enabled=1

2、安装这个包有300多M

yum install -y gitlab-ce

3、配置也需要几分钟时间

[root@test-7 ~]# gitlab-ctl reconfigure

4、以下表示配置完成

gitlab安装配置、备份恢复

5、先停掉

[root@test-7 ~]# gitlab-ctl stop

gitlab安装配置、备份恢复

6、再启动

[root@test-7 ~]# gitlab-ctl start

gitlab安装配置、备份恢复

7、浏览器访问,输入IP即可

8、[root@test-7 ~]# systemctl stop firewalld

[root@test-7 ~]# systemctl stop iptable

9、设置root的密码

gitlab安装配置、备份恢复

10、

gitlab安装配置、备份恢复

1、nginx相关配置

[root@test-7 ~]# ls /var/opt/gitlab/nginx/conf/nginx.conf 

/var/opt/gitlab/nginx/conf/nginx.conf

2、gitlab相关配置文件

[root@test-7 ~]# ls /var/opt/gitlab/nginx/conf/gitlab-http.conf 

/var/opt/gitlab/nginx/conf/gitlab-http.conf

3、若是外网访问则需要修改servername即可

4、新建组web、java、IOS

gitlab安装配置、备份恢复

5、新建用户

gitlab安装配置、备份恢复

6、

gitlab安装配置、备份恢复

7、首先创建组,然后是用户,最后项目关联到组

8、gitlab备份

gitlab备份: gitlab-rake gitlab:backup:create

备份目录:

[root@test-7 ~]# ls /var/opt/gitlab/backups/

1513173483_2017_12_13_10.2.4_gitlab_backup.tar

gitlab恢复

1、停服务

[root@test-7 ~]# gitlab-ctl stop unicorn ; gitlab-ctl stop sidekiq

ok: down: unicorn: 1s, normally up

ok: down: sidekiq: 1s, normally up

2、gitlab-rake gitlab:backup:restore BACKUP=xxxxx (这里是一个编号,即备份文件的前缀)

[root@test-7 ~]# gitlab-rake gitlab:backup:restore BACKUP=1513173483_2017_12_13_10.2.4

输入2个yes

3、再启动服务 gitlab-ctl start

版权声明:原创作品,如需转载,请注明出处。否则将追究法律责任

本文转自 jiekegz  51CTO博客,原文链接:http://blog.51cto.com/jacksoner/2050426

继续阅读