下载gitlab的RPM包
下载安装:
https://packages.gitlab.com/gitlab/gitlab-ce
ce表示开源
el表示centos 选64位
el6对应CentOS 6
2.创建存放gitlab安装包的目录,并将下载好的gitlab安装包放进去
mkdir /home/soft/gitlab_soft
3.安装PRM包
rpm -ivh gitlab-ce-15.0.5-ce.0.el7.x86_64.rpm
安装成功后显示
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=15-0
4.打开配置文件
vim /etc/gitalb/gitlab.rb
external_url 'http://instance-0ndv0diu' -- 原来的
external_url 'http://你的IP' --修改后
此配置在文件最前边的几行,不需要往后翻很多,要留意
5.然后执行 生效配置代码
gitlab-ctl reconfigure
提示以下信息就说明安装成功了
Running handlers:
There was an error running gitlab-ctl reconfigure:
Cannot set unsupported config value eternal_url.
Running handlers complete
Cinc Client failed. 0 resources updated in 06 seconds
6.查看服务状态
gitlab-ctl status
会看到以下信息
Running handlers:
Running handlers complete
Cinc Client finished, 608/1619 resources updated in 07 minutes 14 seconds
Notes:
Default admin account has been configured with following details:
Username: root
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 passcurity/reset_user_password.html#reset-your-root-password.
gitlab Reconfigured!
[root@localhost opt]# gitlab-ctl status
run: alertmanager: (pid 13062) 27s; run: log: (pid 12551) 136s
run: gitaly: (pid 13042) 28s; run: log: (pid 11793) 399s
run: gitlab-exporter: (pid 13013) 29s; run: log: (pid 12444) 212s
run: gitlab-kas: (pid 12967) 30s; run: log: (pid 12114) 379s
run: gitlab-workhorse: (pid 12987) 30s; run: log: (pid 12280) 255s
run: grafana: (pid 13161) 26s; run: log: (pid 12924) 42s
run: logrotate: (pid 11683) 412s; run: log: (pid 11712) 409s
run: nginx: (pid 12335) 252s; run: log: (pid 12358) 249s
run: node-exporter: (pid 12998) 30s; run: log: (pid 12410) 240s
run: postgres-exporter: (pid 13153) 26s; run: log: (pid 12606) 121s
run: postgresql: (pid 11936) 389s; run: log: (pid 11957) 386s
run: prometheus: (pid 13024) 28s; run: log: (pid 12504) 178s
run: puma: (pid 12190) 270s; run: log: (pid 12201) 267s
run: redis: (pid 11724) 406s; run: log: (pid 11732) 405s
run: redis-exporter: (pid 13015) 29s; run: log: (pid 12469) 192s
run: sidekiq: (pid 12219) 264s; run: log: (pid 12234) 263s
[root@localhost opt]#
看到上面就说明彻底安装成功了
7.gitlab 安装初始化后,默认账户名是root,密码存放在配置文件
查看初始化密码命令:
cat /etc/gitlab/initial_root_password
[root@localhost gitlab]# cat 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: Nr/3tNiHy7YvTpn9hknQ/5lGg8kcu+aob1rHsRUQ3hM=
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
######密码存放在初始化文件里面,但是只存放24小时,登录gitlab要及时更改密码 ,默认用户是root
这个文件将在首次执行reconfigure后24小时自动删除。----切记
8.访问gitlab
直接在浏览器上输入配置文件中的IP就可以了,没有端口
192.168.201.11
9.更改密码:
10.更改完重新登陆就可以了!