文章目录
环境准备
三台服务器
服务器环境 | 服务器名称 | 服务器IP | 需要多少内存(G) |
---|---|---|---|
gitlab | c7-41 | 10.0.0.41 | 4 |
jenkins+maven | c7-42 | 10.0.0.42 | 1 |
tomcat | c7-43 | 10.0.0.43 | 2 |
1、更换阿里云
1.1下载wget
[root@ c7-41 ~]# yum -y install wget
1.2备份默认的yum
[root@ c7-41 ~]# mv /etc/yum.repos.d /etc/yum.repos.d.backup
1.3设置新的yum目录
[root@ c7-41 ~]# mkdir /etc/yum.repos.d
1.4下载阿里yum配置到该目录中
[root@ c7-41 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
1.5重建缓存
[root@ c7-41 ~]# yum clean all
[root@ c7-41 ~]# yum makecache
1.6升级所有包(改变软件设置和系统设置,系统版本内核都升级,故需要几分钟耐心等待)
[root@ c7-41 ~]# yum -y update
1.7安装vim(个人习惯)
[root@ c7-41 ~]# yum -y install vim
2、获取gitlab汉化包
2.1安装git
[root@ c7-41 ~]# yum -y install git
2.2克隆获取汉化版本库
下载最新的汉化包
[root@ c7-41 ~]# git clone https://gitlab.com/xhang/gitlab.git
Cloning into 'gitlab'...
remote: Enumerating objects: 40998, done.
remote: Counting objects: 100% (40998/40998), done.
remote: Compressing objects: 100% (15116/15116), done.
remote: Total 1059432 (delta 27453), reused 35303 (delta 25250), pack-reused 1018434
Receiving objects: 100% (1059432/1059432), 458.83 MiB | 222.00 KiB/s, done.
Resolving deltas: 100% (824561/824561), done.
2.3查看汉化补丁的版本
[root@ c7-41 ~]# cat gitlab/VERSION
12.3.5
3、部署社区版gitlab
3.1安装gitlab的依赖项
[root@ c7-41 ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python
#10.x以后开始依赖policycoreutils-python
**3.2启动postfix,并设置为开机启动 **
[root@ c7-41 ~]# systemctl start postfix
[root@ c7-41 ~]# systemctl enable postfix
**3.3关闭防火墙 **
[root@ c7-41 ~]# systemctl stop firewalld
[root@ c7-41 ~]# setenforce 0
setenforce: SELinux is disabled
3.4获取gitlab的rpm包
途径1:通过清华开源镜像站
Index of /gitlab-ce/yum/el7/ 搜索网址
找到之前下载的汉化包的版本然后下载
可以使用路径下载也可以直接在网页下载安装包(作者直接在网页下载的gitlab包,网慢的可能要很久)
[root@ c7-41 ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
3.5上传并安装rpm包
[root@ c7-41 ~]# rz -e #上传rpm包
[root@ c7-41 ~]# ls
anaconda-ks.cfg gitlab gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
[root@ c7-41 ~]# rpm -ivh gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm #安装rpm包
warning: gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:gitlab-ce-12.3.5-ce.0.el7 ################################# [100%]
It looks like GitLa