使用清華鏡像源配置yum源:
vim /etc/yum.repos.d/gitlab.repo
[Gitlab-CE]
name=GitlabCE
baseurl=https:
//mirror
.tuna.tsinghua.edu.cn
/gitlab-ce/yum/el6/
enabled=1
gpgcheck=0
2. yum安裝
yum installgitlab-ce -y
3. gitlab配置(/opt/gitlab/gitlab.rb)
external_url'
#配置服務器IP地址或域名
#配置e-mail
gitlab_rails[
'time_zone'
]=
'UTC'
gitlab_rails[
'gitlab_email_enabled'
]=
true
gitlab_rails[
'gitlab_email_from'
]=
'[email protected]'
gitlab_rails[
'gitlab_email_display_name'
]=
'APICloud_Gitlab'
gitlab_rails[
'gitlab_email_reply_to'
]=
'[email protected]'
gitlab_rails[
'smtp_enable'
]=
true
gitlab_rails[
'smtp_address'
]=
"smtp.163.com"
gitlab_rails[
'smtp_port'
]=25
gitlab_rails[
'smtp_user_name'
]=
"[email protected]"
gitlab_rails[
'smtp_password'
]=
"nxgfvizafijytymx"
gitlab_rails[
'smtp_domain'
]=
"163.com"
gitlab_rails[
'smtp_authentication'
]=
"login"
gitlab_rails[
'smtp_enable_starttls_auto'
]=
true
gitlab_rails[
'smtp_tls'
]=
false
gitlab_ci[
'smtp_enable'
]=
true
gitlab_ci[
'smtp_address'
]=
"smtp.163.com"
gitlab_ci[
'smtp_port'
]=25
gitlab_ci[
'smtp_user_name'
]=
"[email protected]"
gitlab_ci[
'smtp_password'
]=
"nxgfvizafijytymx"
gitlab_ci[
'smtp_domain'
]=
"163.com"
gitlab_ci[
'smtp_authentication'
]=
"login"
gitlab_ci[
'smtp_enable_starttls_auto'
]=
true
4. gitlab命令
重置配置,使修改生效
gitlab-ctlreconfigure
b. 登錄測試
Username:root(管理員賬號)
Password:5iveL!fe
c. 解決gitlab默認頭像不能正常顯示的問題
gitlab_rails[
'gravatar_plain_url'
]=
'http://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
gitlab_rails[
'gravatar_ssl_url'
]=
'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
5. 開機自啟動腳本設置
vim
/opt/startGitlab
.sh
==========================
#!/bin/bash
sudo
lokkit-shttp-s
ssh
==========================
echo
"/opt/startGitlab.sh"
>>vim
/etc/rc
.d
/rc
.
local
================================================
6. 數據備份與恢復
數據備份及恢復命令:
備份path:
/var/opt/gitlab/backups
(備份和恢復文件都是git用戶)
數據備份:gitlab-rakegitlab:backup:create
數據恢復:gitlab-rakegitlab:backup:restore
使用Gitlab一鍵安裝包後的日常備份恢復與遷移https://segmentfault.com/a/1190000002439923
創建備份:gitlab-rakegitlab:backup:create
恢復備份:
#停止相關數據連接服務
gitlab-ctlstopunicorn
gitlab-ctlstopsidekiq
#從1393513186編號備份中恢復
gitlab-rakegitlab:backup:restoreBACKUP=1393513186
#啟動Gitlab
sudo
gitlab-ctlstart
7. 參考鏈接:
http:
//swht1278
.blog.51cto.com
/7138082/1643939
http://xxxxxx/Linuxjc/1156077.html TechArticle