成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

DevOps-版本控制系統-GitLab部署

開源
本篇給大家介紹DevOps-版本控制系統-GitLab部署,希望對你有所幫助。

 使用RPM包部署

這里使用的系統是CentOS8, 清華源:mirrors.tuna.tsinghua.edu.cn/gitlab-ce/

  1. ## 下載軟件包 
  2. wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm 
  3.  
  4. ## 安裝 
  5. rpm -ivh gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm 
  6.  
  7. ## 日志輸出 
  8. warning: gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID f27eab47: NOKEY 
  9. Verifying...                          ################################# [100%] 
  10. Preparing...                          ################################# [100%] 
  11. Updating / installing... 
  12.    1:gitlab-ce-13.7.0-ce.0.el8        ################################# [100%] 
  13. It looks like GitLab has not been configured yet; skipping the upgrade script. 
  14.  
  15.        *.                  *. 
  16.       ***                 *** 
  17.      *****               ***** 
  18.     .******             ******* 
  19.     ********            ******** 
  20.    ,,,,,,,,,***********,,,,,,,,, 
  21.   ,,,,,,,,,,,*********,,,,,,,,,,, 
  22.   .,,,,,,,,,,,*******,,,,,,,,,,,, 
  23.       ,,,,,,,,,*****,,,,,,,,,. 
  24.          ,,,,,,,****,,,,,, 
  25.             .,,,***,,,, 
  26.                 ,*,. 
  27.  
  28.  
  29.  
  30.      _______ __  __          __ 
  31.     / ____(_) /_/ /   ____ _/ /_ 
  32.    / / __/ / __/ /   / __ `/ __ \ 
  33.   / /_/ / / /_/ /___/ /_/ / /_/ / 
  34.   \____/_/\__/_____/\__,_/_.___/ 
  35.  
  36.  
  37. Thank you for installing GitLab! 
  38. GitLab was unable to detect a valid hostname for your instance. 
  39. Please configure a URL for your GitLab instance by setting `external_url` 
  40. configuration in /etc/gitlab/gitlab.rb file. 
  41. Then, you can start your GitLab instance by running the following command: 
  42.   sudo gitlab-ctl reconfigure 
  43.  
  44. For a comprehensive list of configuration options please see the Omnibus GitLab readme 
  45. https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 
  46.  
  47. Help us improve the installation experience, let us know how we did with a 1 minute survey: 
  48. https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=13-7 

配置

安裝完成后可以發現以下信息,需要修改gitlab.rb配置文件。

  • GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting external_urlconfiguration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure

編輯 /etc/gitlab/gitlab.rb 可以看到默認的域名配置。如果是學習使用則可以繼續使用該域名,不用再做其他配置。

  1. 32 external_url 'http://gitlab.example.com' 

如果是需要修改該域名,則需要這樣做:

  1. ## 修改gitlab.rb 
  2. external_url 'http://gitlab.devops.com' 
  3. ## 重新配置 
  4. gitlab-ctl reconfigure 

服務運行控制

  1. ## 啟動服務 
  2. gitlab-ctl start 
  3. ## 重啟服務 
  4. gitlab-ctl restart  
  5. ## 查看狀態 
  6. gitlab-ctl status  
  7. ## 停止 
  8. gitlab-ctl stop 

訪問測試

由于使用的是gitlab.devops.com 這個域名,需要在dns或者本地hosts中添加該解析記錄。

  1. vi /etc/hosts 
  2. 192.168.1.200 gitlab.devops.com 

瀏覽器訪問http://gitlab.devops.com/, 設置用戶密碼。默認用戶root。這里設置的密碼是devops1234。


能夠正常進入首頁即可,安裝完成。


擴展:使用外部PG數據庫

使用docker快速啟動PG

  • You are using PostgreSQL 9.6.16, but PostgreSQL >= 11 is required for this version of GitLab.
  1. mkdir /root/gitlab/pgdata 
  2.  
  3. docker run --name dockerPG11 \ 
  4. -e POSTGRES_PASSWORD=postgres \ 
  5. -v /root/gitlab/pgdata:/var/lib/postgresql/data \ 
  6. -p 54322:5432 \ 
  7. -d postgres:11.5 
  8.  
  9. ## 創建數據庫 
  10. psql -U postgres -h localhost -p 54322 
  11. psql (11.5 (Debian 11.5-3.pgdg90+1)) 
  12. Type "help" for help. 
  13. postgres=# create role gitlab login encrypted password 'gitlab'
  14. CREATE ROLE 
  15. postgres=# create database gitlabhq_production owner=gitlab ENCODING = 'UTF8'
  16. CREATE DATABASE 
  17. postgres=# \c gitlabhq_production 
  18. You are now connected to database "gitlabhq_production" as user "postgres"
  19. gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS btree_gist; 
  20. CREATE EXTENSION 
  21. gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS pg_trgm; 
  22. CREATE EXTENSION 
  23. postgres=# \q 

使用postgres用戶創建 EXTENSION, btree_gist, pg_trgm。否則會遇到如下錯誤:

  • STDOUT: psql:/opt/gitlab/embedded/service/gitlab-rails/db/structure.sql:9: ERROR: permission denied to create extension "btree_gist" HINT: Must be superuser to create this extension.

修改gitlab.rb配置文件

編輯/etc/gitlab/gitlab.rb

  1. 654 gitlab_rails['db_adapter'] = "postgresql" 
  2. 655 gitlab_rails['db_encoding'] = "utf8" 
  3. 656 # gitlab_rails['db_collation'] = nil 
  4. 657 gitlab_rails['db_database'] = "gitlabhq_production" 
  5. 658 gitlab_rails['db_username'] = "gitlab" 
  6. 659 gitlab_rails['db_password'] = "gitlab" 
  7. 660 gitlab_rails['db_host'] = "192.168.1.200" 
  8. 661 gitlab_rails['db_port'] = 54322 
  9. 1025 postgresql['enable'] = false 
  10.  
  11. ## 配置更新 
  12. gitlab-ctl reconfigure 

驗證配置生效

  1. cat /opt/gitlab/embedded/service/gitlab-rails/config/database.yml 
  2.  
  3. # This file is managed by gitlab-ctl. Manual changes will be 
  4. # erased! To change the contents below, edit /etc/gitlab/gitlab.rb 
  5. and run `sudo gitlab-ctl reconfigure`. 
  6.  
  7. production: 
  8.   adapter: postgresql 
  9.   encoding: utf8 
  10.   collation: 
  11.   database: gitlabhq_production 
  12.   username: "gitlab" 
  13.   password"gitlab" 
  14.   host: "192.168.1.200" 
  15.   port: 54322 

 

責任編輯:姜華 來源: DevOps云學堂
相關推薦

2021-02-03 07:16:49

DevOps開發工具

2009-03-23 09:53:47

LinuxGNOMEGit版本

2009-04-01 17:58:28

MercurialPython版本控制

2011-04-08 18:00:19

GitSubversion版本控制系統

2011-01-26 09:09:06

版本控制系統GitLinux

2022-09-14 09:18:52

SubversionLinux系統

2022-03-17 00:07:00

工業控制系統

2022-09-13 09:00:19

SubversionLinux

2020-09-27 09:50:35

自動化

2021-12-08 14:06:19

Python語音識別開發

2014-06-23 10:22:18

2023-05-24 14:58:23

2017-09-01 06:45:37

2023-10-16 12:42:00

物聯網IOT

2020-06-15 10:53:16

工控安全工業控制網絡安全

2010-09-14 14:22:22

2023-10-24 20:41:28

物聯網控制系統

2023-07-31 10:15:14

物聯網智能家居

2010-06-04 09:33:34

電子訪問控制生物識別身份驗證

2014-07-31 16:22:38

githubLinux
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产日韩一区二区三免费高清 | 日韩欧美在线播放 | 欧美一区中文字幕 | 午夜一区二区三区在线观看 | 91就要激情 | 久久久久久久久久久久亚洲 | 亚洲视频在线看 | 国产一区二区三区 | 男人阁久久 | 91久久北条麻妃一区二区三区 | 日韩一区二区三区在线 | 国产成人免费在线观看 | 精品久久久久久久久久久久久久 | 国产黄色av网站 | 综合国产第二页 | 日本亚洲欧美 | 超碰97人人人人人蜜桃 | 九九精品久久久 | av喷水 | 一级二级三级黄色 | 天天夜夜操 | 羞羞视频网站在线观看 | 国产91精品久久久久久久网曝门 | 欧美一级片在线 | 精品福利在线 | www日本在线播放 | 精品视频在线免费观看 | 久久精品国产一区 | 国产精品高潮呻吟久久av野狼 | 搞av.com | 欧美伊人久久久久久久久影院 | 亚洲网站在线观看 | 成人午夜精品 | 久久成人免费视频 | 亚洲国产成人精品久久 | 成人小视频在线免费观看 | 国产成人精品一区二区 | 国产 日韩 欧美 在线 | 免费看片国产 | 福利视频一区二区三区 | 伊人久久在线观看 |