CentOS 7.x 使用 RPM 包安装 Gitlab

02-28 阅读 0评论
官网:https://about.gitlab.com/
https://about.gitlab.cn/install/
安装:https://gitlab.cn/install/
博客:https://gitlab.cn/blog/
文档:https://docs.gitlab.com/
https://about.gitlab.com/install/#centos-7
https://docs.gitlab.com/ee/install/requirements.html
官方下载:https://packages.gitlab.com/gitlab/gitlab-ce
国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
教程:https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos
https://docs.gitlab.cn/omnibus/installation/
【安装环境要求】
CPU:建议使用双核或以上的CPU
内存:建议使用4GB或以上内存,内存最小4GB (gitlab need 3GB+)
硬盘:建议使用至少50GB的硬盘空间,如果需要使用git-lfs,则建议使用100GB或以上的硬盘空间
操作系统:建议使用Linux操作系统,推荐使用Ubuntu或CentOS操作系统
网络要求:开放端口TCP-80和TCP-443端口,TCP-22端口用于SSH访问。如果使用HTTP协议,则需要开放TCP-81端口
         TCP-25端口用于SMTP邮件服务
注意:自从gitlab12.1开始,后端存储不再支持mysql,而是仅支持一种数据PostgreSQL
【配置主机名与ip地址】
cd /etc/sysconfig/network-scripts/
vim /etc/hostname
设置主机名为:gitlab-server
如果是个人本地虚拟机安装,则配置win10的hosts文件,配置gitlab-server的ip映射关系
【安装依赖】
sudo yum -y update
sudo yum install -y curl openssl-devel policycoreutils-python openssh-server perl rsync
sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
【下载/安装GitLab】
https://archlinux.org/packages/?q=gitlab
https://packages.gitlab.com/gitlab/gitlab-ce
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm/download.rpm
【编写安装脚本】
# vim gitlab-install.sh
sudo rpm -ivh /path-to/gitlab-ce-13.12.15-ce.0.el7.x86_64
sudo yum install -y curl policycoreutils-python openssh-server perl cronie
sudo lokkit -s http -s ssh
sudo yum install -y postfix
sudo systemctl enable postfix
sudo systemctl start postfix
# 配置GitLab 软件源镜像 - 如果是离线安装,这一步可以省略
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce
【给脚本赋予执行权限 - 执行安装】
添加脚本执行权限:chmod +x gitlab-install.sh
执行脚本安装gitlab:./gitlab-install.sh
安装:sudo yum install gitlab-ce-13.12.15-ce.0.el7.x86_64 -y
查看版本:cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
【配置gitlab】
配置参考:https://gitlab.com/gitlab-org/gitlab-recipes/-/blob/master/web-server/nginx/gitlab-omnibus-nginx.conf
安装成功后,修改ip和端口
命令:vim /etc/gitlab/gitlab.rb
修改 external_url ,将 http://gitlab.example.com 换成自己的 ip 或域名,如:http://IP:端口,一定要带上协议!
默认端口:80
【初始化gitlab服务】
# 初始化配置 - 重新加载配置文件
sudo gitlab-ctl reconfigure   -- 命令执行成功显示:gitlab Reconfigured!
sudo gitlab-ctl start
sudo gitlab-ctl restart
sudo gitlab-ctl stop
sudo gitlab-ctl status
控制台命令: gitlab-rails console
退出控制台:quit
【登录修改root账号的密码】
参考:https://docs.gitlab.cn/omnibus/installation/
cat /etc/gitlab/initial_root_password
登录:浏览器输入ip:port   -- 首次登录要消耗一点时间,耐心等一下
登录成功会直接跳转到修改root密码界面
设置密码:Admin123
修改密码后再次登录,禁用注册功能:http://123.60.171.255/help/user/admin_area/settings/sign_up_restrictions
【安装Runner - 可选项】
安装参考:https://docs.gitlab.com/runner/install/
【运维常用命令】
gitlab-ctl start #启动全部服务
gitlab-ctl restart#重启全部服务
gitlab-ctl stop #停止全部服务
gitlab-ctl restart nginx #重启单个服务,如重启nginx
gitlab-ctl status #查看服务状态
gitlab-ctl reconfigure #使配置文件生效
gitlab-ctl show-config #验证配置文件
gitlab-ctl uninstall #删除gitlab(保留数据)
gitlab-ctl cleanse #删除所有数据,从新开始
gitlab-ctl tail 查看服务的日志
gitlab-ctl tail nginx #如查看gitlab下nginx日志
gitlab-rails console #进入控制台
gitlab-ctl help #查看gitlab帮助信息
CentOS 7.x 使用 RPM 包安装 Gitlab,CentOS 7.x 使用 RPM 包安装 Gitlab,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,安装,配置,第1张
(图片来源网络,侵删)
CentOS 7.x 使用 RPM 包安装 Gitlab,CentOS 7.x 使用 RPM 包安装 Gitlab,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,安装,配置,第2张
(图片来源网络,侵删)
CentOS 7.x 使用 RPM 包安装 Gitlab,CentOS 7.x 使用 RPM 包安装 Gitlab,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,安装,配置,第3张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,人围观)

还没有评论,来说两句吧...

目录[+]