gitlab部署!

gitlab的部署!

1. 安装gitlab的rpm包!!

[root@localhost ~]# wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm/download.rpm
--2021-06-09 21:25:40--  https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm/download.rpm
正在解析主机 packages.gitlab.com (packages.gitlab.com)... 54.153.54.194, 2600:1f1c:2d4:8900:17a1:2e94:9f90:f91e
正在连接 packages.gitlab.com (packages.gitlab.com)|54.153.54.194|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://d20rj4el6vkp4c.cloudfront.net/7/8/el/8/package_files/68965.rpm?t=1623288641_d8da5eebcb09a5c5084cf4b38c9e05dea9bcc72a [跟随至新的 URL]
--2021-06-09 21:25:41--  https://d20rj4el6vkp4c.cloudfront.net/7/8/el/8/package_files/68965.rpm?t=1623288641_d8da5eebcb09a5c5084cf4b38c9e05dea9bcc72a
正在解析主机 d20rj4el6vkp4c.cloudfront.net (d20rj4el6vkp4c.cloudfront.net)... 54.230.130.53, 54.230.130.91, 54.230.130.27, ...
正在连接 d20rj4el6vkp4c.cloudfront.net (d20rj4el6vkp4c.cloudfront.net)|54.230.130.53|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:922721674 (880M) [application/x-rpm]
正在保存至: “download.rpm”

download.rpm         100%[====================>] 879.98M  10.3MB/s  用时 80s     

2021-06-09 21:27:01 (11.0 MB/s) - 已保存 “download.rpm” [922721674/922721674])

[root@localhost ~]# 

2. 安装所需要的依赖包!!!

[root@localhost ~]# dnf -y install policycoreutils-python-utils curl openssh-server openssh-clients postfix cronie git
上次元数据过期检查:1 day, 10:54:15 前,执行于 2021年06月08日 星期二 10时34分15秒。
软件包 policycoreutils-python-utils-2.9-9.el8.noarch 已安装。
软件包 curl-7.61.1-17.el8.x86_64 已安装。
软件包 openssh-server-8.0p1-5.el8.x86_64 已安装。
软件包 openssh-clients-8.0p1-5.el8.x86_64 已安装。
软件包 cronie-1.5.2-4.el8.x86_64 已安装。
依赖关系解决。
==================================================================================
 软件包                          架构      版本                仓库          大小
==================================================================================
安装:
 git                             x86_64    2.27.0-1.el8        appstream    164 k
 postfix                         x86_64    2:3.5.8-1.el8       baseos       1.5 M
升级:
 curl                            x86_64    7.61.1-18.el8       baseos       353 k
 libcurl                         x86_64    7.61.1-18.el8       baseos       299 k
 openssh                         x86_64    8.0p1-8.el8         baseos       521 k
 openssh-askpass                 x86_64    8.0p1-8.el8         appstream     92 k
 openssh-clients                 x86_64    8.0p1-8.el8         baseos       667 k
 openssh-server                  x86_64    8.0p1-8.el8         baseos       484 k
 policycoreutils                 x86_64    2.9-14.el8          baseos       373 k
 policycoreutils-python-utils    noarch    2.9-14.el8          baseos       252 k
 python3-policycoreutils         noarch    2.9-14.el8          baseos       2.2 M
安装依赖关系:
 git-core                        x86_64    2.27.0-1.el8        appstream    5.7 M
 git-core-doc                    noarch    2.27.0-1.el8        appstream    2.5 M
 perl-Error                      noarch    1:0.17025-2.el8     appstream     46 k
 perl-Git                        noarch    2.27.0-1.el8        appstream     77 k

事务概要
==================================================================================
安装  6 软件包
升级  9 软件包

总下载:15 M
下载软件包:
(1/15): git-2.27.0-1.el8.x86_64.rpm               476 kB/s | 164 kB     00:00    
(2/15): perl-Error-0.17025-2.el8.noarch.rpm       354 kB/s |  46 kB     00:00    
(3/15): perl-Git-2.27.0-1.el8.noarch.rpm          545 kB/s |  77 kB     00:00    
(4/15): git-core-doc-2.27.0-1.el8.noarch.rpm      3.7 MB/s | 2.5 MB     00:00    
(5/15): openssh-askpass-8.0p1-8.el8.x86_64.rpm    945 kB/s |  92 kB     00:00    
(6/15): git-core-2.27.0-1.el8.x86_64.rpm          5.0 MB/s | 5.7 MB     00:01    
(7/15): curl-7.61.1-18.el8.x86_64.rpm             963 kB/s | 353 kB     00:00    
(8/15): postfix-3.5.8-1.el8.x86_64.rpm            2.2 MB/s | 1.5 MB     00:00    
(9/15): openssh-8.0p1-8.el8.x86_64.rpm            2.6 MB/s | 521 kB     00:00    
(10/15): libcurl-7.61.1-18.el8.x86_64.rpm         1.0 MB/s | 299 kB     00:00    
(11/15): openssh-server-8.0p1-8.el8.x86_64.rpm    4.3 MB/s | 484 kB     00:00    
(12/15): openssh-clients-8.0p1-8.el8.x86_64.rpm   3.7 MB/s | 667 kB     00:00    
(13/15): policycoreutils-python-utils-2.9-14.el8. 4.0 MB/s | 252 kB     00:00    
(14/15): policycoreutils-2.9-14.el8.x86_64.rpm    2.8 MB/s | 373 kB     00:00    
(15/15): python3-policycoreutils-2.9-14.el8.noarc 6.5 MB/s | 2.2 MB     00:00    
----------------------------------------------------------------------------------
总计                                              5.1 MB/s |  15 MB     00:02     
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                   1/1 
  运行脚本: openssh-8.0p1-8.el8.x86_64                                        1/1 
  运行脚本: openssh-8.0p1-8.el8.x86_64                                       1/24 
  升级    : openssh-8.0p1-8.el8.x86_64                                       1/24 
  升级    : libcurl-7.61.1-18.el8.x86_64                                     2/24 
  升级    : openssh-clients-8.0p1-8.el8.x86_64                               3/24 
  安装    : git-core-2.27.0-1.el8.x86_64                                     4/24 
  安装    : git-core-doc-2.27.0-1.el8.noarch                                 5/24 
  升级    : policycoreutils-2.9-14.el8.x86_64                                6/24 
  运行脚本: policycoreutils-2.9-14.el8.x86_64                                6/24 
  升级    : python3-policycoreutils-2.9-14.el8.noarch                        7/24 
  安装    : perl-Error-1:0.17025-2.el8.noarch                                8/24 
  安装    : perl-Git-2.27.0-1.el8.noarch                                     9/24 
  安装    : git-2.27.0-1.el8.x86_64                                         10/24 
  升级    : policycoreutils-python-utils-2.9-14.el8.noarch                  11/24 
  升级    : curl-7.61.1-18.el8.x86_64                                       12/24 
  升级    : openssh-askpass-8.0p1-8.el8.x86_64                              13/24 
  运行脚本: openssh-server-8.0p1-8.el8.x86_64                               14/24 
  升级    : openssh-server-8.0p1-8.el8.x86_64                               14/24 
  运行脚本: openssh-server-8.0p1-8.el8.x86_64                               14/24 
  运行脚本: postfix-2:3.5.8-1.el8.x86_64                                    15/24 
  安装    : postfix-2:3.5.8-1.el8.x86_64                                    15/24 
  运行脚本: postfix-2:3.5.8-1.el8.x86_64                                    15/24 
  清理    : curl-7.61.1-17.el8.x86_64                                       16/24 
  清理    : policycoreutils-python-utils-2.9-9.el8.noarch                   17/24 
  清理    : python3-policycoreutils-2.9-9.el8.noarch                        18/24 
  运行脚本: openssh-server-8.0p1-5.el8.x86_64                               19/24 
  清理    : openssh-server-8.0p1-5.el8.x86_64                               19/24 
  运行脚本: openssh-server-8.0p1-5.el8.x86_64                               19/24 
  清理    : openssh-clients-8.0p1-5.el8.x86_64                              20/24 
  清理    : openssh-askpass-8.0p1-5.el8.x86_64                              21/24 
  清理    : openssh-8.0p1-5.el8.x86_64                                      22/24 
  运行脚本: policycoreutils-2.9-9.el8.x86_64                                23/24 
  清理    : policycoreutils-2.9-9.el8.x86_64                                23/24 
  清理    : libcurl-7.61.1-17.el8.x86_64                                    24/24 
  运行脚本: libcurl-7.61.1-17.el8.x86_64                                    24/24 
  验证    : git-2.27.0-1.el8.x86_64                                          1/24 
  验证    : git-core-2.27.0-1.el8.x86_64                                     2/24 
  验证    : git-core-doc-2.27.0-1.el8.noarch                                 3/24 
  验证    : perl-Error-1:0.17025-2.el8.noarch                                4/24 
  验证    : perl-Git-2.27.0-1.el8.noarch                                     5/24 
  验证    : postfix-2:3.5.8-1.el8.x86_64                                     6/24 
  验证    : openssh-askpass-8.0p1-8.el8.x86_64                               7/24 
  验证    : openssh-askpass-8.0p1-5.el8.x86_64                               8/24 
  验证    : curl-7.61.1-18.el8.x86_64                                        9/24 
  验证    : curl-7.61.1-17.el8.x86_64                                       10/24 
  验证    : libcurl-7.61.1-18.el8.x86_64                                    11/24 
  验证    : libcurl-7.61.1-17.el8.x86_64                                    12/24 
  验证    : openssh-8.0p1-8.el8.x86_64                                      13/24 
  验证    : openssh-8.0p1-5.el8.x86_64                                      14/24 
  验证    : openssh-clients-8.0p1-8.el8.x86_64                              15/24 
  验证    : openssh-clients-8.0p1-5.el8.x86_64                              16/24 
  验证    : openssh-server-8.0p1-8.el8.x86_64                               17/24 
  验证    : openssh-server-8.0p1-5.el8.x86_64                               18/24 
  验证    : policycoreutils-2.9-14.el8.x86_64                               19/24 
  验证    : policycoreutils-2.9-9.el8.x86_64                                20/24 
  验证    : policycoreutils-python-utils-2.9-14.el8.noarch                  21/24 
  验证    : policycoreutils-python-utils-2.9-9.el8.noarch                   22/24 
  验证    : python3-policycoreutils-2.9-14.el8.noarch                       23/24 
  验证    : python3-policycoreutils-2.9-9.el8.noarch                        24/24 
Installed products updated.

已升级:
  curl-7.61.1-18.el8.x86_64                                                       
  libcurl-7.61.1-18.el8.x86_64                                                    
  openssh-8.0p1-8.el8.x86_64                                                      
  openssh-askpass-8.0p1-8.el8.x86_64                                              
  openssh-clients-8.0p1-8.el8.x86_64                                              
  openssh-server-8.0p1-8.el8.x86_64                                               
  policycoreutils-2.9-14.el8.x86_64                                               
  policycoreutils-python-utils-2.9-14.el8.noarch                                  
  python3-policycoreutils-2.9-14.el8.noarch                                       

已安装:
  git-2.27.0-1.el8.x86_64                 git-core-2.27.0-1.el8.x86_64            
  git-core-doc-2.27.0-1.el8.noarch        perl-Error-1:0.17025-2.el8.noarch       
  perl-Git-2.27.0-1.el8.noarch            postfix-2:3.5.8-1.el8.x86_64            

完毕!
[root@localhost ~]# 

3. 关闭防火墙,开启邮箱服务!

[root@localhost ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# systemctl start postfix
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# 

4. 开始安装gitlab!

[root@localhost ~]#  rpm -ivh download.rpm 
警告:download.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:gitlab-ce-13.12.3-ce.0.el8       ################################# [100%]
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=13-12

[root@localhost ~]# 

5. 修改配置文件为本机ip!

[root@localhost ~]# sed -i "s#^external_url 'http://gitlab.example.com'#external_url 'http://192.168.170.100'#g" /etc/gitlab/gitlab.rb

6. 重新读取配置文件并且重启!

[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 51252) 0s
ok: run: gitaly: (pid 51295) 1s
ok: run: gitlab-exporter: (pid 51321) 0s
ok: run: gitlab-workhorse: (pid 51336) 1s
ok: run: grafana: (pid 51364) 0s
ok: run: logrotate: (pid 51412) 1s
ok: run: nginx: (pid 51450) 0s
ok: run: node-exporter: (pid 51463) 0s
ok: run: postgres-exporter: (pid 51468) 0s
ok: run: postgresql: (pid 51548) 1s
ok: run: prometheus: (pid 51593) 0s
ok: run: puma: (pid 51710) 0s
ok: run: redis: (pid 51718) 1s
ok: run: redis-exporter: (pid 51780) 0s
ok: run: sidekiq: (pid 51917) 0s

7. 查看端口号!

[root@localhost ~]# ss -antl
State    Recv-Q   Send-Q     Local Address:Port     Peer Address:Port   Process   
LISTEN   0        1024           127.0.0.1:9100          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9229          0.0.0.0:*                
LISTEN   0        128              0.0.0.0:111           0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:8080          0.0.0.0:*                
LISTEN   0        128            127.0.0.1:9168          0.0.0.0:*                
LISTEN   0        511              0.0.0.0:80            0.0.0.0:*                
LISTEN   0        128            127.0.0.1:8082          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9236          0.0.0.0:*                
LISTEN   0        32         192.168.122.1:53            0.0.0.0:*                
LISTEN   0        128              0.0.0.0:22            0.0.0.0:*                
LISTEN   0        5              127.0.0.1:631           0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:3000          0.0.0.0:*                
LISTEN   0        100            127.0.0.1:25            0.0.0.0:*                
LISTEN   0        511              0.0.0.0:8060          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9121          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9090          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9187          0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9093          0.0.0.0:*                
LISTEN   0        5                0.0.0.0:873           0.0.0.0:*                
LISTEN   0        128                 [::]:111              [::]:*                
LISTEN   0        128                [::1]:9168             [::]:*                
LISTEN   0        128                 [::]:22               [::]:*                
LISTEN   0        5                  [::1]:631              [::]:*                
LISTEN   0        100                [::1]:25               [::]:*                
LISTEN   0        1024                   *:9094                *:*                
LISTEN   0        5                   [::]:873              [::]:*                
[root@localhost ~]# 

8. 修改密码!!

[root@localhost ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.12.3 (757327a59bc) FOSS
 GitLab Shell: 13.18.0
 PostgreSQL:   12.6
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.6)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = 'liuzezheng'
=> "liuzezheng"
irb(main):003:0> user.password_confirmation = 'liuzezheng'
=> "liuzezheng"
irb(main):004:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 36cdd4b3-19f5-4936-92e8-af0c6a4ed69f) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f91f2532470 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):005:0> exit

9. 使用IP访问gitlab网页!

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值