gitlab 常用命令自查表

gitlab

# 查看当前gitlab版本号
 cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
 
# 查看gitlab配置文件
vim /etc/gitlab/gitlab.rb

#运行配置文件
gitlab-ctl reconfigure

# 重启gitlab 
gitlab-ctl restart
# 其他
gitlab-ctl start
gitlab-ctl stop
  1. 版本升级 gitlab 不允许直接升级,需要参考 官方升级路线
  2. gitlab 502报错 - 添加unicorn端口号
external_url 'http://10.10.10.249:7777'
unicorn['port'] = 8182
  1. gitlab 汉化
    gitlab 汉化

gitlab 定时备份

/***************第一步************************/
 crontab工具执行自动备份
 vim /etc/crontab // 查看crontab 文件
 // 设置凌晨2点自动备份
 0 2  *  *  * root /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
 
 /*************第二步***********************/
 // 打开gitlab配置文件
 vim /etc/gitlab/gitlab.rb
 // 文件内设置命令 
### back                                                                      gitlab_rails['manage_backup_path']=true #管理备份路径
gitlab_rails['backup_path'] = '/gitlab/backups' #路径地址
gitlab_rails['backup_archive_permissions']=0644 #权限存档                     gitlab_rails['backup_keep_time']=7776000 #备份保存时间:3个月    

 /*************第三步***重启********************/
 gitlab-ctl reconfigure 
 systemctl restart crond

/**************手动备份*******************************/
 gitlab-rake gitlab:backup:create

frp穿透

frpc.ini 配置文件

[common]
server_addr = www.abc.com
server_port = 7000

[gitssh]
type = tcp
local_ip = 10.10.10.249
local_port = 22
remote_port = 20021

[gitweb]
type = http
local_ip = 10.10.10.249
local_port = 7777
remote_port = 20020
custom_domains = www.abc.com

启动frpc.ini

./frpc -c ./frpc.ini

后期维护自查

进入girlab 
 docker exec -it gitlab_13.12.15 /bin/bash  
备份
gitlab-rake gitlab:backup:create
查找
find / -name  1645442127_2022_02_21_13.12.15_g
迁移
mv 1695277008_2023_09_21_13.12.15_gitlab_backup.tar /home/gitlab/gitlab_backups
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值