部署Gitlab(一)

简介: 部署Gitlab(一)

环境 centos7.6,gitlab-ce 12.3.5版本

①了解gitlab的服务构成

②了解gitlab的优点

一:1.1安装依赖包

yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python

1.2:启动postfix,设置为开启自启

systemctl start postfix
systemctl enable postfix

1.3:设置防火墙规则,重启防火墙,有些需要自行启动防火墙,不然往下会提示web访问失败

firewall-cmd --add-service=http --permanent
firewall-cmd --reload

二:2.1下载安装gitlab rpm包,rpm安装

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

2.2修改里面的配置文件gitlab.rb

vim  /etc/gitlab/gitlab.rb
## GitLab configuration settings
##! This file is generated during initial installation and **is not** modified
##! during upgrades.
##! Check out the latest version of this file to know about the different
##! settings that can be configured by this file, which may be found at:
##! https://gitlab.com/gitlab-org/omnibus-gitlab/raw/master/files/gitlab-config-template/gitlab.rb.template
 
 
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
#external_url 'http://gitlab.example.com'
external_url 'http://192.168.3.120:8081'        # 修改这个地方为你主机的ip地址,这里我设置了8081端口,不加端口即默认80

重新加载配置文件,重新启动gitlab

gitlab-ctl reconfigure
gitlab-ctl restart

2.3接下来我们就可以在浏览器输入http://192.168.3.120:8081
进去后会叫你修改密码,如果无法访问出现502
①可能是gitlab端口号被占用,修改为其它端口即可;
②主机内存不足
查看端口情况,找到自己设置的8081端口

netstat -ntpl

捕获.PNG

以上是正常,如果被其它程序占用即kill -9pid掉

gitlab-ctl restart

重新启动一下即可
二:汉化,ce版需要下载汉化配置文件,ee版则在web端即可实现汉化(自带)
2.1查看gitlab版本,注意汉化版本需与安装的gitlab版本一致

head -1 /opt/gitlab/version-manifest.txt           
git clone https://gitlab.com/xhang/gitlab.git -b v12.3.5-zh

进入刚刚clone下来的目录

cd gitlab/

用diff将英文原版与中文版的对比生成.diff文件

git diff v12.3.5 v12.3.5-zh > /root/v12.3.5-zh.diff
[root@gitlab gitlab]# gitlab-ctl stop              #停止gitlab
[root@gitlab gitlab]# yum -y install patch
[root@gitlab gitlab]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 <  ../v12.3.5-zh.diff
 #将刚才的diff文件做为补丁导入到gitlab中
#该命令执行过程中,输入一次y然后一路回车跳过即可
[root@gitlab gitlab]# gitlab-ctl start                 #启动gitlab
[root@gitlab gitlab]# gitlab-ctl reconfigure      #重新配置gitlab

2.2web访问gitlab即可成功,如果还是无法访问就把防火墙重启一下,有些只是部分汉化了,需要自行到偏好设置里去调一下,切换为中文即可

相关文章
|
6月前
|
Linux 网络安全 数据安全/隐私保护
手把手教你使用Docker部署Gitlab仓库
手把手教你使用Docker部署Gitlab仓库
157 0
|
6月前
|
Devops 开发工具 git
【devops】二、Code阶段工具——容器部署Gitlab
【devops】二、Code阶段工具——容器部署Gitlab
|
6月前
|
存储 Java Linux
Jenkins+Gitlab+Docker(Dockerfile)部署
Jenkins+Gitlab+Docker(Dockerfile)部署
139 1
|
6月前
|
Kubernetes NoSQL 关系型数据库
通过helm部署gitlab服务
通过helm部署gitlab服务
|
6月前
|
缓存 程序员 开发工具
服务搭建篇(八) 使用GitLab部署一个属于自己的代码托管平台
服务启动完成后,就可以访问gitlab服务了。默认的服务端口就是80端口。默认的用户名和密码是 root/123456(通常建议登录后立即修改默认密码)
196 0
|
Ubuntu 应用服务中间件 项目管理
部署gitlab详解
部署gitlab详解
部署gitlab详解
|
16天前
无缝构建与部署:GitLab CI/CD首秀的实战攻略
无缝构建与部署:GitLab CI/CD首秀的实战攻略
29 0
无缝构建与部署:GitLab CI/CD首秀的实战攻略
|
6月前
|
Kubernetes NoSQL 关系型数据库
通过编写k8s的资源清单yaml文件部署gitlab服务
通过编写k8s的资源清单yaml文件部署gitlab服务
|
5月前
|
Linux 开发工具 git
淘东电商项目(07) -GitLab简介以及Docker部署
淘东电商项目(07) -GitLab简介以及Docker部署
72 0
|
8月前
|
缓存 Kubernetes Docker
GitLab Runner部署(kubernetes环境)
记录K8S环境部署GitLab Runner的详细步骤
271 2
GitLab Runner部署(kubernetes环境)