安装gitlab

下载安装

gitlab/gitlab-ce - Packages · packages.gitlab.com

或gitLab的linux安装包-管理软件文档类资源-CSDN下载
ce表示开源

el表示centos   选64位

el6对应CentOS 6

我这里是先下载再上传后安装

在linux上创建了一个gitLab用于存放上传安装包的文件目录

执行
rpm -i gitlab-ce-15.0.5-ce.0.el7.x86_64.rpm --force --nodeps
安装完成后显示

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

然后打开配置文件

`vim /etc/gitalb/gitlab.rb`
external_url 'http://instance-0ndv0diu'  -- 原来的
external_url 'http://192.168.1.50'  --修改后

然后执行
sudo 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

由于不小心把external_url 变成eternal_url 了所以报错了,修改后可以
重新执行
sudo gitlab-ctl reconfigure
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]# 

1.gitlab 安装初始化后,默认账户名是root,密码存放在配置文件

/etc/gitlab/initial_root_password

2.gitlab 在centerOS7中的配置目录在/etc/gitlab/
gitlab-ce-14初装以后,把密码放在了一个临时文件里面了。

initial_root_password
这个文件将在首次执行reconfigure后24小时自动删除,文件内容:

[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.

账号:root 密码:Nr/3tNiHy7YvTpn9hknQ/5lGg8kcu+aob1rHsRUQ3hM=

3.将Password内容复制去登录界面即可

https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-15.0.5-ce.0.el7.x86_64.rpm

posted @ 2022-07-30 16:22  donghongchao  阅读(921)  评论(0编辑  收藏  举报