[CentOS7.5]GitLab

本文详细介绍GitLab的下载、安装步骤,包括使用rpm包安装、配置修改、启动与重启命令,以及如何进行数据备份与恢复操作。同时,提供修改GitLab仓库存储位置的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gitlab的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

rpm -ivh gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

gitlab-ctl reconfigure
gitlab-ctl start

 

gitlab-ctl restart

gitlab-ctl stop 

 

备份操作

$ sudo gitlab-rake gitlab:backup:create

 

Gitlab恢复操作 

[root@code-server backups]# gitlab-ctl stop unicorn

ok: down: unicorn: 0s, normally up

[root@code-server backups]# gitlab-ctl stop sidekiq

ok: down: sidekiq: 1s, normally up

[root@localhost ~]# mv 1541520439_2018_11_07_11.3.5_gitlab_backup.tar /var/opt/gitlab/backups
 

[root@localhost ~]# gitlab-rake gitlab:backup:restore BACKUP=1541520439_2018_11_07_11.3.5

[root@code-server backups]# gitlab-ctl start

恢复命令完成后,可以check检查一下恢复情况

[root@code-server backups]# gitlab-rake gitlab:check SANITIZE=true

 

 

gitlab仓库存储位置的修改方法

gitlab通过rpm包安装后,默认存储位置在/var/opt/gitlab/git-data/repositories,通常需要更改此路径到单独的一个分区来存储仓库的数据。

例如我这里把数据存放到/data/gitlab目录下

创建/data/gitlab目录

 

1

mkdir -p /data/gitlab

修改gitlab配置文件,找到git_data_dir

 

1

vim /etc/gitlab/gitlab.rb

在git_data_dir下面添加一句git_data_dir "/data/gitlab"

停止当前gitlab,重新加载配置

 

1

2

gitlab-ctl stop

gitlab-ctl reconfigure

重新加载后,会发现在/data/gitlab目录下多出一个repositories目录

最后启动gitlab即可

 

1

gitlab-ctl start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值