GitLab CE安裝nginx
安裝比較簡單,rpm直接在不一樣平臺安裝git
https://about.gitlab.com/installation/
直接下載源包地址數據庫
https://about.gitlab.com/downloads/archives/bash
安裝 #yum install curl openssh-server openssh-clients postfix cronie #service postfix start #chkconfig postfix on #lokkit -s http -s ssh #rpm -i gitlab-ce-XXX.rpm
GitLab加載配置與啓動ssh
#gitlab-ctl reconfigure #gitlab-ctl start/restart
GitLab日誌查看
curl
#gitlab-ctl tail nginx #gitlab-ctl tail unicorn
GitLab CE 備份與恢復socket
備份ide
gitlab-rake gitlab:backup:create 可設置自動備份任務 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:creat
更改默認路徑,能夠在 /etc/gitlab/gitlab.rb
文件的 gitlab_rails['backup_path']
項中進行設置,默認爲 /var/opt/gitlab/backups
。gitlab
恢復post
# 中止須要鏈接數據庫的服務 #gitlab-ctl stop unicorn #gitlab-ctl stop sidekiq # 恢復備份的數據,重寫數據庫內容 # GitLab 8.15 版本之前所用的時間戳格式爲 EPOCH (1393513186) #gitlab-rake gitlab:backup:restore BACKUP=1459620009 # 或# GitLab 8.15 版本之後所用的時間戳格式爲 EPOCH_YYYY_MM_DD (1491415349_2017_04_06) # gitlab-rake gitlab:backup:restore BACKUP=1491415349_2017_04_06 # 啓動 GitLabsudo gitlab-ctl start # 檢查 GitLab 是否正常運行 #gitlab-rake gitlab:check SANITIZE=true
GitLab CE遷移與升級
遷移可參考備份與恢復,須要注意的是:版本號必定要一致
升級
跨版本升級在這裏不過多介紹,如大版本9,升級過程下載相關安裝包進行安裝,自動會完成升級
GitLab CE 使用小節
一、項目地址爲localhost
#vi /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: localhost port: 80 https: false
二、merge 、chekout 出現如下錯誤:
GitLab: The project you were looking for could not be found.
此類錯誤多出如今git-data掛載軟連接致使
如個人掛載 /var/opt/gitlab -> /data/gitlab, 修改參照如下
# /etc/gitlab/gitlab.rb ...... git_data_dirs({ "default" => { "path" => "</data/gitlab/git-data>", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } }) ......