Gitlab安装

DevOps GitLab评论867字数 3234阅读10分46秒阅读模式

Gitlab是一个利用Ruby on Rails开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人的项目 Gitlab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,他非常易于浏览提交过的版本并提供一个文件历史库。他还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。

安装

下载rpm包

[root@gitlab ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm
--2022-11-06 12:44:22--  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1101365956 (1.0G) [application/x-redhat-package-manager]
Saving to: ‘gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm’

100%[==================================================================================================>] 1,101,365,956 1.87MB/s   in 10m 24s

2022-11-06 12:54:48 (1.68 MB/s) - ‘gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm’ saved [1101365956/1101365956]

[root@gitlab ~]#  rpm -ivh gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm 
warning: gitlab-ce-15.3.5-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-15.3.5-ce.0.el7        ################################# [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=15-3

配置域名

[root@gitlab ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.centoscn.vip'

配置安装

[root@gitlab ~]# gitlab-ctl reconfigure
  • 上面配置命令执行后,如没有报错,就说明gitlab配置成功。配置后会生成各应用服务配置文件,放在/opt/gitlab/etc下,日志路径为/var/log/gitlab/

查看状态

[root@gitlab ~]#  gitlab-ctl status
run: alertmanager: (pid 10449) 47s; run: log: (pid 10220) 89s
run: gitaly: (pid 10468) 46s; run: log: (pid 9401) 200s
run: gitlab-exporter: (pid 10423) 48s; run: log: (pid 10010) 107s
run: gitlab-kas: (pid 10395) 50s; run: log: (pid 9711) 183s
run: gitlab-workhorse: (pid 10404) 50s; run: log: (pid 9883) 125s
run: logrotate: (pid 9290) 215s; run: log: (pid 9321) 212s
run: nginx: (pid 9913) 120s; run: log: (pid 9921) 119s
run: node-exporter: (pid 10418) 49s; run: log: (pid 9973) 113s
run: postgres-exporter: (pid 10463) 46s; run: log: (pid 10277) 81s
run: postgresql: (pid 9542) 192s; run: log: (pid 9601) 189s
run: prometheus: (pid 10432) 48s; run: log: (pid 10181) 95s
run: puma: (pid 9792) 139s; run: log: (pid 9812) 136s
run: redis: (pid 9332) 209s; run: log: (pid 9355) 206s
run: redis-exporter: (pid 10425) 48s; run: log: (pid 10086) 99s
run: sidekiq: (pid 9822) 133s; run: log: (pid 9841) 130s

访问

Gitlab安装

 

继续阅读
DevOps
  • 本文由 发表于 2022年11月6日 20:57:46
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
Gitlab配置HTTPS GitLab

Gitlab配置HTTPS

简述 gitlab最新是开启https会自动配置,但只有三个月有效期,使用自己设的加密证书应设置。 配置 [root@iZ8vb3ycs3gfmlbmyxy6efZ ~]# vim /etc/g...
评论  0  访客  0

发表评论