1 下载Gitlab服务器软件包
下载地址:https://packages.gitlab.com/gitlab/gitlab-ce
选择自己需要的版本下载即可,我是用的是centos 7,所以我下载的是gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm
点击右上方download下载,或者复制下方的wget下载
我这里选择的是wget下载方式,不需要单独在上传一次。建议用download方式先下载下来,MD5校验一下,和页面上的MD5值对比,保证文件的完整性
[root@k8s-node2 ~]# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm/download.rpm
--2022-08-31 10:30:25-- https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm/download.rpm
Resolving packages.gitlab.com (packages.gitlab.com)... 104.18.27.123, 104.18.26.123, 2606:4700::6812:1a7b, ...
Connecting to packages.gitlab.com (packages.gitlab.com)|104.18.27.123|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://d20rj4el6vkp4c.cloudfront.net/7/8/el/7/package_files/88759.rpm?t=1661913359_2efbf97e9189648ad90f368be3b5c24df5d51e21 [following]
--2022-08-31 10:30:25-- https://d20rj4el6vkp4c.cloudfront.net/7/8/el/7/package_files/88759.rpm?t=1661913359_2efbf97e9189648ad90f368be3b5c24df5d51e21
Resolving d20rj4el6vkp4c.cloudfront.net (d20rj4el6vkp4c.cloudfront.net)... 65.9.58.119, 65.9.58.38, 65.9.58.228, ...
Connecting to d20rj4el6vkp4c.cloudfront.net (d20rj4el6vkp4c.cloudfront.net)|65.9.58.119|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1101655026 (1.0G) [application/x-rpm]
Saving to: ‘gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm’
100%[========================================================================================================================>] 1,101,655,026 977KB/s in 16m 8s
2022-08-31 10:46:35 (1.09 MB/s) - ‘gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm’ saved [1101655026/1101655026]
2 安装Gitlab
下载网页也有对应install命令,复制直接在服务器运行即可
yum install gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm -y
[root@k8s-node2 ~]# yum install gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm -y
Loaded plugins: fastestmirror
Examining gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm: gitlab-ce-15.3.2-ce.0.el7.x86_64
Marking gitlab-ce-15.3.2-ce.0.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package gitlab-ce.x86_64 0:15.3.2-ce.0.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================
Installing:
gitlab-ce x86_64 15.3.2-ce.0.el7 /gitlab-ce-15.3.2-ce.0.el7.x86_64 2.3 G
Transaction Summary
====================================================================================================================================================================
Install 1 Package
Total size: 2.3 G
Installed size: 2.3 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gitlab-ce-15.3.2-ce.0.el7.x86_64 1/1
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=15-3
Verifying : gitlab-ce-15.3.2-ce.0.el7.x86_64 1/1
Installed:
gitlab-ce.x86_64 0:15.3.2-ce.0.el7
Complete!
3 配置Gitlab
默认使用的是80端口,如果需要修改端口还需要修改配置文件vim /var/opt/gitlab/nginx/conf/gitlab-http.conf,把80监听端口改掉
vim /etc/gitlab/gitlab.rb
把external_url 'http://gitlab.example.com' 修改成节点地址或者域名
[root@k8s-node2 ~]# cat /etc/gitlab/gitlab.rb | grep -v ^# | grep -v ^$
external_url 'http://192.168.198.147'
4 重新配置gitlab
[root@k8s-node2 ~]# gitlab-ctl reconfigure
Running handlers:
[2022-08-31T11:19:23+08:00] INFO: Running report handlers
Running handlers complete
[2022-08-31T11:19:23+08:00] INFO: Report handlers complete
Infra Phase complete, 571/1532 resources updated in 03 minutes 47 seconds
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.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
gitlab Reconfigured!
5 访问gitlab
访问地址:http://192.168.198.147
默认账户名是root,密码存放在配置文件 /etc/gitlab/initial_root_password
登录后可自行修改密码
标签:x86,ce.0,gitlab,离线,ce,64,安装包,el7 From: https://www.cnblogs.com/xmwan/p/16642241.html