ce服务器修复,GitLab CE服务器安装配置备份恢复升级注意项总结

本文详细介绍了GitLab CE(社区版)的安装步骤,包括通过rpm包安装、配置、启动、日志查看、备份与恢复。此外,还提到了迁移和升级的方法。在使用中,注意配置GitLab的项目地址,并解决可能出现的checkout错误问题。

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

GitLab CE安装

安装比较简单,rpm直接在不同平台安装https://about.gitlab.com/installation/

直接下载源包地址

安装

#yum install curl openssh-server openssh-clients postfix cronie

#service postfix start

#chkconfig postfix on

#lokkit -s http -s ssh

#rpm -i gitlab-ce-XXX.rpm

GitLab加载配置与启动#gitlab-ctl reconfigure

#gitlab-ctl start/restart

GitLab日志查看#gitlab-ctl tail nginx

#gitlab-ctl tail unicorn

GitLab CE 备份与恢复

备份gitlab-rake gitlab:backup:create

可设置自动备份任务

0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:creat

更改默认路径,可以在/etc/gitlab/gitlab.rb文件的gitlab_rails['backup_path']项中进行设置,默认为/var/opt/gitlab/backups。

恢复# 停止需要连接数据库的服务

#gitlab-ctl stop unicorn

#gitlab-ctl stop sidekiq

# 恢复备份的数据,重写数据库内容

# GitLab 8.15 版本以前所用的时间戳格式为 EPOCH (1393513186)

#gitlab-rake gitlab:backup:restore BACKUP=1459620009

# 或# GitLab 8.15 版本以后所用的时间戳格式为 EPOCH_YYYY_MM_DD (1491415349_2017_04_06)

# gitlab-rake gitlab:backup:restore BACKUP=1491415349_2017_04_06

# 启动 GitLabsudo gitlab-ctl start

# 检查 GitLab 是否正常运行

#gitlab-rake gitlab:check SANITIZE=true

GitLab CE迁移与升级

迁移可参考备份与恢复,需要注意的是:版本号一定要一致

升级

跨版本升级在这里不过多介绍,如大版本9,升级过程下载相关安装包进行安装,自动会完成升级

GitLab CE 使用小节

1、项目地址为localhost

#vi/var/opt/gitlab/gitlab-rails/etc/gitlab.yml## GitLab settings

gitlab:

## Web server settings (note: host is the FQDN, do not include http://)

host: localhost

port: 80

https: false

2、merge 、chekout 出现以下错误:

GitLab: The project you were looking for could not be found.

此类错误多出现在git-data挂载软链接导致

如我的挂载 /var/opt/gitlab -> /data/gitlab, 修改参照以下# /etc/gitlab/gitlab.rb

......

git_data_dirs({ "default" => { "path" => "", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } })

......

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值