gitlab-代码管理工具的离线安装部署
最低安装条件:
资源 | 最低限度 | 推荐 |
---|---|---|
CPU | 2核 | 4核 |
内存 | 4 GB | 8 GB |
解决安装依赖
yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python
gitlab
的rpm包下载
开始rpm安装
[root@localhost ~]# rpm -ivh gitlab-ce-16.2.6-ce.0.el7.x86_64.rpm
警告:gitlab-ce-16.2.6-ce.0.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:gitlab-ce-16.2.6-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=16-2
修改gitlab配置文件信息,指定服务ip和端口号
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
#external_url 'http://gitlab.example.com'
#找到这行将url修改为自己的服务器ip和端口号
external_url 'http://ip:端口号'
将external_url后面的url替换为自己的ip+端口号,(查看端口是否被占用,防火墙是否放开)
加载配置信息
[root@localhost ~]# gitlab-ctl reconfigure
# 最后输出这些信息
Notes:
Default admin account has been configured with following details:
# 管理员用户名
Username: root
# 管理员密码,查看/etc/gitlab/initial_root_password,但是24h后删除需及时修改
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
gitlab Reconfigured!
注:如果发现ip
或者端口
等配置信息需要更改,每次更改完之后,一定要重新加载配置 gitlab-ctl reconfigure
重启gitlab服务
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 4076) 1s
ok: run: gitaly: (pid 4084) 1s
ok: run: gitlab-exporter: (pid 4097) 0s
ok: run: gitlab-kas: (pid 4112) 0s
ok: run: gitlab-workhorse: (pid 4120) 1s
ok: run: logrotate: (pid 4130) 0s
ok: run: nginx: (pid 4136) 1s
ok: run: node-exporter: (pid 4142) 0s
ok: run: postgres-exporter: (pid 4147) 0s
ok: run: postgresql: (pid 4174) 1s