Gitlab14.x 安装、配置、启动 (Centos/Red Hat7/8.x)
文章目錄
- 一、下載、安裝、配置依賴
- 1. 安裝配置需要的依賴
- 2. Gitlab下載
- 3. 安裝Gitlab
- 4. 配置external_url
- 5. 重新加載配置文件
- 6. 查看服務狀態
- 7. 配置防火墻
- 8. 瀏覽器驗證
- 9. 尋找密碼信息
- 10. 查看密碼
- 11. 重新登陸
- 12. 修改密碼
- 13. 重新登陸
- 14. Gitlab常用命令
聲明:Centos/Red Hat7/8.x 下載、安裝、配置不通的地方我會進行特殊說明,未說明的屬于共有部分。
一、下載、安裝、配置依賴
1. 安裝配置需要的依賴
https://about.gitlab.com/install/#centos-7
2. Gitlab下載
Centos/Red Hat7.x 下載鏈接:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
Centos/Red Hat8.x 下載鏈接:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/
3. 安裝Gitlab
# Centos/Red Hat7.x 安裝方式 [root@localhost ~]# rpm -ivh gitlab-ce-14.2.3-ce.0.el7.x86_64.rpm # Centos/Red Hat8.x 安裝方式 [root@localhost ~]# rpm -ivh gitlab-ce-14.2.3-ce.0.el8.x86_64.rpm操作記錄:
[root@localhost ~]# rpm -ivh gitlab-ce-14.2.3-ce.0.el7.x86_64.rpm 警告:gitlab-ce-14.2.3-ce.0.el7.x86_64.rpm: 頭V4 RSA/SHA1 Signature, 密鑰 ID f27eab47: NOKEY 準備中... ################################# [100%] 正在升級/安裝...1:gitlab-ce-14.2.3-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 reconfigureFor a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.mdHelp 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=14-2[root@localhost ~]#4. 配置external_url
[root@localhost ~]# vim /etc/gitlab/gitlab.rb 將 #external_url 'http://gitlab.example.com'調整為http://+ip:端口的格式 external_url 'http://192.168.159.102:8000'5. 重新加載配置文件
[root@localhost ~]# sudo gitlab-ctl reconfigure
等著安裝完畢就好了
6. 查看服務狀態
sudo gitlab-ctl status7. 配置防火墻
#開放端口(開放后需要要重啟防火墻才生效) firewall-cmd --zone=public --add-port=8000/tcp --permanent# 重新啟動防火墻 firewall-cmd --reload8. 瀏覽器驗證
# 格式:IP+端口號(默認8080) http://192.168.159.102:8000/這個Gitlab14.x版本,和以前有些不同,以前的第一次訪問會讓你設置root用戶的密碼,但是這個版本,默認為你配置了密碼
9. 尋找密碼信息
安裝完成后,最后會有以下信息
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 password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.gitlab Reconfigured!關鍵信息說明:
默認管理員用戶名是root,root用戶的密碼存放到/etc/gitlab/initial_root_password文件中了,請在24小時內修改密碼。
10. 查看密碼
[root@localhost ~]# 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: oQIWkCNmUtrOeYebj8vVJ53CocII+ZlpWhzssaLUH5c=# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours. [root@localhost ~]#11. 重新登陸
12. 修改密碼
13. 重新登陸
14. Gitlab常用命令
| 重啟配置,并啟動gitlab服務 | sudo gitlab-ctl reconfigure |
| 啟動所有 gitlab | sudo gitlab-ctl start |
| 重新啟動GitLab | sudo gitlab-ctl restart |
| 停止所有 gitlab | sudo gitlab-ctl stop |
| 查看服務狀態 | sudo gitlab-ctl status |
| 查看Gitlab日志 | sudo gitlab-ctl tail |
| 修改默認的配置文件 | sudo vim /etc/gitlab/gitlab.rb |
| 檢查gitlab | gitlab-rake gitlab:check SANITIZE=true --trace |
接下一篇:Centos/Red Hat7/8.x 安裝、配置、啟動Gitlab14.x (語言和主題配置
想學習更多前后端分離、微服務、分布式、MQ/緩存/引擎中間件、數據庫、項目重構技巧等系列技術
請移步技術專欄 https://gblfy.com
讓我們一起進步!!!
總結
以上是生活随笔為你收集整理的Gitlab14.x 安装、配置、启动 (Centos/Red Hat7/8.x)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nacos 适配达梦、人大金仓数据库
- 下一篇: Centos/Red Hat7/8.x