开始
官网,移至Solutions下点击Enterprise →,点击- Docs,点击Explore all topics,点击Install GitLab,点击Installation methods,点击Linux packages (Omnibus),点击Installation
环境
| IP | node |
|---|---|
| 172.20.20.227 | localhost |
配置依赖项
在 CentOS 7上,下面的命令也会在系统防火墙中打开 HTTP、HTTPS 和 SSH 访问。可选步骤,如果您打算仅从本地网络访问极狐GitLab,则可以跳过它
sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
安装 Postfix
用于发送电子邮件通知
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
安装方式
All GitLab packages are posted to the GitLab package server.
package repository
下载安装包地址,选择安装版本
安装
sudo rpm -Uvh gitlab-ee-14.6.7-ee.0.el7.x86_64.rpm
manual installation
配置存储库
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
识别版本
# Ubuntu/Debian
sudo apt-cache madison gitlab-ee
# RHEL/CentOS 6 and 7
yum --showduplicates list gitlab-ee
# RHEL/CentOS 8
dnf --showduplicates list gitlab-ee
# SUSE
zypper search -s gitlab-ee
安装指定版本
# Ubuntu/Debian
sudo apt install gitlab-ee=<version>
# RHEL/CentOS 6 and 7
yum install gitlab-ee-<version>
# RHEL/CentOS 8
dnf install gitlab-ee-<version>
# SUSE
zypper install gitlab-ee=<version>
设置域名/URL
#修改配置文件
[root@rabbitmq2 home]# vim /etc/gitlab/gitlab.rb
# add your server IP
external_url 'http://172.20.20.227'
#save quit
重新配置GitLab
sudo gitlab-ctl reconfigure
启动
gitlab-ctl restart
查看状态
[root@rabbitmq2 home]# gitlab-ctl status
run: alertmanager: (pid 12490) 2306s; run: log: (pid 11800) 2436s
run: gitaly: (pid 12505) 2305s; run: log: (pid 11075) 2559s
run: gitlab-exporter: (pid 12517) 2304s; run: log: (pid 11694) 2459s
run: gitlab-workhorse: (pid 12519) 2304s; run: log: (pid 11581) 2483s
run: grafana: (pid 12526) 2304s; run: log: (pid 12165) 2359s
run: logrotate: (pid 12535) 2303s; run: log: (pid 10984) 2571s
run: nginx: (pid 12541) 2303s; run: log: (pid 11605) 2479s
run: node-exporter: (pid 12550) 2303s; run: log: (pid 11657) 2470s
run: postgres-exporter: (pid 12554) 2302s; run: log: (pid 11863) 2427s
run: postgresql: (pid 12649) 2298s; run: log: (pid 11279) 2546s
run: prometheus: (pid 12651) 2298s; run: log: (pid 11762) 2444s
run: puma: (pid 12666) 2297s; run: log: (pid 11461) 2502s
run: redis: (pid 12671) 2297s; run: log: (pid 11027) 2565s
run: redis-exporter: (pid 12680) 2297s; run: log: (pid 11731) 2449s
run: sidekiq: (pid 12690) 2290s; run: log: (pid 11496) 2494s
登录
随机生成一个密码并存储在 /etc/gitlab/initial_root_password 文件中
[root@rabbitmq2 home]# 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: lLFFAuOywEBpYvSig/FhlwhMzO3PR3HsPhfzhPHkBMs=
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.