极狐Gitlab安装部署

GitLab 是一个基于 Git 的开源 DevOps 平台,提供代码仓库管理、CI/CD(持续集成和持续交付)、项目管理、监控和安全等功能。它集成了多种工具,帮助开发团队在一个平台上进行代码开发、测试、部署和运维。以下是 GitLab 的主要功能和使用方法:

主要功能:

  1. 代码管理

    • 提供 Git 仓库托管和版本控制。
    • 支持分支管理、代码审查和合并请求(Merge Requests)。
  2. 持续集成和持续交付(CI/CD)

    • 使用 GitLab CI/CD 管道自动化构建、测试和部署。
    • 集成 Docker 容器,支持 Kubernetes 集群部署。
  3. 项目管理

    • 提供问题跟踪(Issues)、看板(Boards)、Wiki 和里程碑(Milestones)功能。
    • 支持敏捷开发和 Scrum 工作流。
  4. 代码质量和安全

    • 集成代码静态分析、依赖性扫描和漏洞检测。
    • 提供代码审查和代码风格检查工具。
  5. 监控和运维

    • 集成 Prometheus 和 Grafana 进行系统和应用监控。
    • 支持日志管理和性能分析。

安装配置Gitlab

 官方网站:

GitLab产品将分为三个发行版:CE(社区版),EE(企业版)和JH(极狐公司自主研发并独立运营GitLab CN 开源代码库)。 

Nexus Repository ManagerNexus Repository Managericon-default.png?t=N7T8https://packages.gitlab.cn/#browse/browse:el

GitLab文档_GitLab官方帮助文档_极狐GitLab 帮助文档中心-极狐GitLab极狐GitLab文档中心拥有GitLab所有的帮助文档,如果您在使用GitLab产品时有任何问题欢迎访问GitLab官方帮助文档。icon-default.png?t=N7T8https://docs.gitlab.cn/  

安装

tty01192.168.226.20

rocky_linux9.4

2核5G内存,20G磁盘

[root@tty01 ~]# sudo yum install -y policycoreutils-python-utils curl openssh-server perl

[root@tty01 ~]# wget https://packages.gitlab.cn/repository/el/9/gitlab-jh-16.11.5-jh.0.el9.x86_64.rpm

[root@tty01 ~]# ll
total 1065240
-rw-------. 1 root root        815 Jun  6 14:00 anaconda-ks.cfg
-rw-r--r--  1 root root 1090799681 Jun 27 23:16 gitlab-jh-16.11.5-jh.0.el9.x86_64.rpm

[root@tty01 ~]# yum install -y gitlab-jh-16.11.5-jh.0.el9.x86_64.rpm

初始化  

# 以下两种方法都可以配置访问地址,第一种需要在yum安装前配置
[root@gitlab ~]# export EXTERNAL_URL='http://192.168.226.20'
或
[root@gitlab ~]# vim /etc/gitlab/gitlab.rb +32
external_url 'http://192.168.249.156'

#重新配置 GitLab 实例,需要等待几分钟
[root@gitlab ~]# gitlab-ctl reconfigure

注: 磁盘或者内存不够会起不来报错。 

[root@tty01 ~]# ss -tnlp
State   Recv-Q  Send-Q   Local Address:Port   Peer Address:Port  Process                                                                           
LISTEN  0       4096         127.0.0.1:9236        0.0.0.0:*      users:(("gitaly",pid=2725,fd=12),("gitaly",pid=2725,fd=6))                       
LISTEN  0       2048         127.0.0.1:9229        0.0.0.0:*      users:(("gitlab-workhors",pid=2733,fd=3))                                        
LISTEN  0       511            0.0.0.0:80          0.0.0.0:*      users:(("nginx",pid=2744,fd=7),("nginx",pid=2743,fd=7),("nginx",pid=2741,fd=7))  
LISTEN  0       4096         127.0.0.1:8151        0.0.0.0:*      users:(("gitlab-kas",pid=2275,fd=7))                                             
LISTEN  0       4096         127.0.0.1:8150        0.0.0.0:*      users:(("gitlab-kas",pid=2275,fd=9))                                             
LISTEN  0       4096         127.0.0.1:8153        0.0.0.0:*      users:(("gitlab-kas",pid=2275,fd=10))                                            
LISTEN  0       4096         127.0.0.1:8155        0.0.0.0:*      users:(("gitlab-kas",pid=2275,fd=11))                                            
LISTEN  0       4096         127.0.0.1:8154        0.0.0.0:*      users:(("gitlab-kas",pid=2275,fd=8))                                             
LISTEN  0       128            0.0.0.0:22          0.0.0.0:*      users:(("sshd",pid=838,fd=3))                                                    
LISTEN  0       1024         127.0.0.1:8080        0.0.0.0:*      users:(("ruby",pid=2617,fd=20),("ruby",pid=2615,fd=20),("ruby",pid=2338,fd=20))  
LISTEN  0       2048         127.0.0.1:8082        0.0.0.0:*      users:(("ruby",pid=2367,fd=10))                                                  
LISTEN  0       2048         127.0.0.1:8092        0.0.0.0:*      users:(("ruby",pid=2365,fd=21))                                                  
LISTEN  0       511            0.0.0.0:8060        0.0.0.0:*      users:(("nginx",pid=2744,fd=8),("nginx",pid=2743,fd=8),("nginx",pid=2741,fd=8))  
LISTEN  0       2048         127.0.0.1:9187        0.0.0.0:*      users:(("postgres_export",pid=2797,fd=3))                                        
LISTEN  0       2048         127.0.0.1:9168        0.0.0.0:*      users:(("gitlab-exporter",pid=2765,fd=6))                                        
LISTEN  0       2048         127.0.0.1:9121        0.0.0.0:*      users:(("redis_exporter",pid=2767,fd=3))                                         
LISTEN  0       2048         127.0.0.1:9093        0.0.0.0:*      users:(("alertmanager",pid=2788,fd=8))                                           
LISTEN  0       2048         127.0.0.1:9090        0.0.0.0:*      users:(("prometheus",pid=2774,fd=7))                                             
LISTEN  0       2048         127.0.0.1:9100        0.0.0.0:*      users:(("node_exporter",pid=2750,fd=3))                                          
LISTEN  0       2048                 *:9094              *:*      users:(("alertmanager",pid=2788,fd=3))                                           
LISTEN  0       2048             [::1]:9168           [::]:*      users:(("gitlab-exporter",pid=2765,fd=5))                                        
LISTEN  0       128               [::]:22             [::]:*      users:(("sshd",pid=838,fd=4))

如果需要手工修改nginx的port ,可以在gitlab.rb中设置 nginx['listen_port'] = 8000 ,然后再次 gitlab-ctl reconfigure即可  

登录 gitlab 如下所示(首次登陆设置 root 密码):  

密码存放在 /etc/gitlab/initial_root_password 文件中,该文件会在24小时后删除  

[root@tty01 ~]# cat /etc/gitlab/initial_root_password 
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: mak3P9+FZAm+tVz1RISxUgDORQrmWwGP6x64aVBWH7c=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

浏览器访问IP地址

http://192.168.226.20/

 设置中文语言

保存后回到主页即可显示中文,然后更改密码即可。

 修改完成后会让你重新登录即可。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ZZDICT

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值