GitLab介绍

GitLab:是一个基于Git实现的在线代码仓库托管软件,你可以用gitlab自己搭建一个类似于Github一样的系统,一般用于在企业、学校等内部网络搭建git私服。

功能:Gitlab 是一个提供代码托管、提交审核和问题跟踪的代码管理平台。对于软件工程质量管理非常重要。

版本:GitLab 分为社区版(CE) 和企业版(EE)。

Gitlab的服务构成

Nginx:静态web服务器。

gitlab-shell:用于处理Git命令和修改authorized keys列表。(Ruby)

gitlab-workhorse: 轻量级的反向代理服务器。(go)

logrotate:日志文件管理工具。

postgresql:数据库。

redis:缓存数据库。

sidekiq:用于在后台执行队列任务(异步执行)。(Ruby)

unicorn:An HTTP server for Rack applications,GitLab Rails应用是托管在这个服务器上面的。(Ruby Web Server,主要使用Ruby编写)

* GitLab Workhorse是一个敏捷的反向代理。它会处理一些大的HTTP请求,比如文件上传、文件下载、Git push/pull和Git包下载。其它请求会反向代理到GitLab Rails应用,即反向代理给后端的unicorn。

01

—

安装Gitlab主程序

root@hello:~# apt update && apt upgrade
root@hello:~# apt install -y curl openssh-server ca-certificates tzdata perl root@hello:~# apt install -y postfix
root@hello:~# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash root@hello:~# apt install gitlab-ee

02

—

修改配置文件

root@hello:~# vim /etc/gitlab/gitlab.rb

external_url 'http://192.168.1.88'

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qiye.aliyun.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "cby"
gitlab_rails['smtp_password'] = "Cby123.."
gitlab_rails['smtp_domain'] = "chenby.cn"
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_pool'] = false root@hello:~# gitlab-ctl reconfigure root@hello:~# gitlab-ctl restart
ok: run: alertmanager: (pid 63590) 1s
ok: run: gitaly: (pid 63610) 1s
ok: run: gitlab-exporter: (pid 63641) 0s
ok: run: gitlab-workhorse: (pid 63643) 1s
ok: run: grafana: (pid 63659) 0s
ok: run: logrotate: (pid 63676) 1s
ok: run: nginx: (pid 63682) 0s
ok: run: node-exporter: (pid 63718) 1s
ok: run: postgres-exporter: (pid 63728) 0s
ok: run: postgresql: (pid 63737) 0s
ok: run: prometheus: (pid 63746) 1s
ok: run: puma: (pid 63777) 1s
ok: run: redis: (pid 63782) 0s
ok: run: redis-exporter: (pid 63788) 1s
ok: run: sidekiq: (pid 63887) 1s
root@hello:~#

03

—

查看root密码

root@hello:~# 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: HUd9b632LHN89WXYEVYPssWGpyJrgK7BJLbVLC4VCas= # NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
root@hello:~#

04

—

常用命令

gitlab-ctl start    # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
vim /etc/gitlab/gitlab.rb # 修改gitlab配置文件;
gitlab-ctl reconfigure # 重新编译gitlab的配置;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;
gitlab-ctl tail nginx/gitlab_access.log 日志地址:/var/log/gitlab/ # 对应各服务的打印日志
服务地址:/var/opt/gitlab/ # 对应各服务的主目录

https://blog.csdn.net/qq_33921750

https://my.oschina.net/u/3981543

https://www.zhihu.com/people/chen-bu-yun-2

https://segmentfault.com/u/hppyvyv6/articles

https://juejin.cn/user/3315782802482007

https://space.bilibili.com/352476552/article

https://cloud.tencent.com/developer/column/93230

https://www.jianshu.com/u/0f894314ae2c

https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/

知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云、简书、今日头条

GitLab 安装部署使用的更多相关文章

  1. 一文搞懂GitLab安装部署及服务配置

    GitLab安装部署 Git,GitHub,GitLab,这三个东东长得好像呀,都是个啥? Git是Linus Torvalds(如果不知道这位大神是谁,请出门左转,慢走不送~)为了帮助管理Linux ...

  2. DevOps实践之Gitlab安装部署

    All GitLab packages are posted to our package server and can be downloaded. We maintain five repos: ...

  3. gitlab安装部署汉化

    1.获取gitlab汉化包(要部署非汉化版,可以跳过这一块内容) 说明:gitlab中文社区版的项目,v7-v8.8是由Larry Li发起的“GitLab 中文社区版项目”(https://gitl ...

  4. Gitlab安装部署及基础操作

      环境说明 系统版本 CentOS 7.2 x86_64(较新版本的gitlab集成了更多功能,顺利运行起来的硬件要求较高,这里给了3G内存) 软件版本 gitlab-ce-10.8.4 GitLa ...

  5. CentOS 7 环境下 GitLab安装部署以及账号初始化

    1. 安装相关依赖 yum install curl policycoreutils openssh-server openssh-clients -y # 确保sshd启动(正常情况下, sshd是 ...

  6. GitLab安装部署与管理

    一.安装Gitlab前系统预配置准备工作 操作系统:centos 7.3 1.关闭firewalld防火墙 #systemctl stop firewalld //关闭防火墙 #systemctl d ...

  7. gitlab安装部署

    参考文章: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos http://www.xsjxmx.com/ ...

  8. GitLab - 安装并启动GitLab

    1 - GitLab安装 1.1 信息确认 [Anliven@node102 ~]$ uname -a Linux node102 3.10.0-957.el7.x86_64 #1 SMP Thu N ...

  9. [转]Centos 7 安装部署 GitLab 服务器

    Centos 7 安装部署 GitLab 服务器 转自:https://www.jianshu.com/p/79bfded68899 文前说明 作为码农中的一员,需要不断的学习,我工作之余将一些分析总 ...

  10. 一、CentOS 7安装部署GitLab服务器

    一.CentOS 7安装部署GitLab服务器 1.安装依赖软件 yum -y install policycoreutils policycoreutils-python openssh-serve ...

随机推荐

  1. webpack打包分析webpack-bundle-analyzer 打包文件分析工具

    最近需要减少项目打包后的文件(bundle)的大小,那么首先需要了解bundle的构成. 目前我已知的方法有两种: 利用webpack-bundle-analyzer插件 利用webpack官方提供的 ...

  2. LINUX配置固定IP以及DNS

    配置固定ip #vim /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=no ...

  3. 从零开始:在树莓派上安装OpenEuler

    树莓派(Raspberry Pi)是一款基于ARM架构的小型电脑,它的便携性和低功耗性能使它成为制作物联网设备或运行嵌入式系统的理想选择.在这篇博客中,我们将介绍如何在树莓派上安装OpenEuler操 ...

  4. Python 错误:ModuleNotFoundError: No module named 'conf'

    问题描述: 编译器无法使用cmd命令来执行py文件,结果可能报ModuleNotFoundError的错误. 比如在cmd任务栏执行:python E:\myProgram\Python\spider ...

  5. layui中文离线文档PDF下载

    失效链接处理 layui中文离线文档 PDF 下载 本站整理下载: 链接:https://pan.baidu.com/s/18FbllhLEezXTn-y1eiiNKg  提取码:nuqz      ...

  6. 第12组 Beta冲刺 (3/5)

    1.1基本情况 ·队名:美少女战士 ·组长博客:https://www.cnblogs.com/yaningscnblogs/p/14016611.html ·作业博客:https://edu.cnb ...

  7. jdbc连接数据库access denied for user 'root'@'localhost'(using password:YES)

    navicat可以进行连接,一般原因为mysql未启用远程连接 以下为解决方案 解决方法-更新用户加密方式: MySQL [mysql]> ALTER USER 'root'@'%' IDENT ...

  8. 关于php pconnect长连接如何刷新连接的讨论

    由于每个pconnect所建立的连接信息和单个进程绑定.线上偶发了redis在某一台机器php-fpm上连接正常而无法进行任何操作的问题. 先说结论 查看redis拓展官方文档 close方法 有一句 ...

  9. Linux(CentOS)安装脚本

    此文以CentOS为例,乌班图的是有区别的,请参照https://www.cnblogs.com/takako_mu/p/11725733.html. 安装.Net Core (能访问外网的情况下采用 ...

  10. 决策树(DecisionTree)(附源码)

    决策树(DecisionTree)   决策树所属类别:监督学习,分类 优点:直观易懂,算法简单 缺点:容易过拟合,对连续型数据不太容易实现 实现方案:ID3,CART,C4.5 详细的资料见连接:别 ...