GitLab安装

本文详细描述了如何在新服务器上从头开始安装GitLab16.4.3,包括下载、依赖安装、配置文件修改、密码管理以及项目远程地址的迁移。遇到问题如supervise_redis_sleep卡住时,提供了解决方案。

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

由于GitLab版本升级麻烦,仓库项目配置较少,于是重新安装配置。

新服务器Linux版本为Alibaba Cloud Linux 3,需要下载el8版本的GitLab。

下载地址

https://packages.gitlab.com/app/gitlab/gitlab-ce/search

下载

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-16.4.3-ce.0.el8.x86_64.rpm/download.rpm

安装依赖

yum install perl

安装GitLab

rpm -ivh gitlab-ce-16.4.3-ce.0.el8.x86_64.rpm

修改配置文件 /etc/gitlab/gitlab.rb

# 把网址改为服务器公网IP(默认IP为80,若80已经使用,自定义其它端口)
external_url 'http://x.x.x.x'

重新加载并启动

gitlab-ctl reconfigure

若结果显示“ruby_block[supervise_redis_sleep] action run”,则会一直卡无法往下进行,这时需要按住“CTRL+C”强制结束,然后运行命令“sudo systemctl restart gitlab-runsvdir”,最后再次执行命令“sudo gitlab-ctl reconfigure”。

重启

gitlab-ctl restart

访问

上述配置的网址

http://x.x.x.x

root账号密码

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

修改root密码

当前密码为上面/etc/gitlab/initial_root_password中的密码

在这里插入图片描述

修改本地项目远端地址

# 查看远程仓库的地址
git remote -v 
# 更换远程仓库地址,URL为新地址
git remote set-url origin URL

推送本地项目到远端,需要项目用户权限为Maintainer

git push -u origin --all
参考

https://zhuanlan.zhihu.com/p/534078400?utm_id=0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值