標籤:backup centos repos 簡單 yum源 image com 技術分享 lte
一、安裝前配置yum源
#wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh#sh script.rpm.sh
二、安裝指定版本的gitlab-ce
#rpm –qa gitlab-ce#yum list gitlab-ce –showduplicates
#yum –y install gitlab-ce-10.6.4-ce.0.el7
三、初次安裝配置啟動
#vi /etc/gitlab/gitlab.rbexternal_url ‘http://10.148.68.13‘#gitlab-ctl reconfigure #此命令是將etc下的gitlab.rb檔案裡的配置同步到gitlab的真實設定檔,一般是gitlab.rb做了修改後使用,需要謹慎其中,執行這步可能會遇見某個地方一直卡住不動,如
解決方案:1.Ctrl+c 2. systemctl restart gitlab-runsvdir 3. gitlab-ctl reconfigure#gitlab-ctl restart
四、配置ldap認證
#vi /etc/gitlab/gitlab.rbgitlab_rails[‘ldap_enabled‘] = truegitlab_rails[‘ldap_servers‘] = YAML.load <<-‘EOS‘ main: # ‘main‘ is the GitLab ‘provider ID‘ of this LDAP serverlabel: ‘LDAP‘host: ‘10.148.3.140‘port: 389uid: ‘uid‘bind_dn: ‘cn=spms,dc=migu,dc=com‘password: ‘[email protected]‘encryption: ‘plain‘ # "start_tls" or "simple_tls" or "plain"active_directory: falseallow_username_or_email_login: trueblock_auto_created_users: falsebase: ‘dc=migu,dc=com‘user_filter: ‘‘EOS#gitlab-ctl reconfigure#gitlab-ctl restart
五、備份與恢複
#vi /etc/gitlab/gitlab.rbgitlab_rails[‘manage_backup_path‘] = true #開啟備份的設定gitlab_rails[‘backup_path‘] = "/var/opt/gitlab/backups" #備份檔案存放目錄gitlab_rails[‘backup_keep_time‘] = 604800 #備份檔案保留時間,秒級備份:#/opt/gitlab/bin/gitlab-rake gitlab:backup:create
恢複:#gitlab-ctl stop unicorn#gitlab-ctl stop sidekiq#/opt/gitlab/bin/gitlab-rake gitlab:backup:restore BACKUP=1528768418#gitlab-ctl start
centos下gitlab的簡單安裝配置