gitlab-ce搭建和数据迁移
2022年11月1日08:26:03
centos7國內(nèi)地址 :注意對應(yīng)的系統(tǒng)版本,下一個最新版本
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/因為數(shù)據(jù)導(dǎo)入導(dǎo)出使用的是gitlab導(dǎo)出 gitlab導(dǎo)入,不需要在乎版本是否匹配,只要能到出,導(dǎo)入成功即可
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.5.1-ce.0.el7.x86_64.rpmyum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python curl yum install gitlab-ce-15.5.1-ce.0.el7.x86_64.rpm系統(tǒng)默認密碼:cat /etc/gitlab/initial_root_password修改防火墻和selinux vi /etc/selinux/config,將SELINUX=enforcing改為SELINUX=disabledsystemctl status firewalld.service systemctl stop firewalld.service systemctl disable firewalld.service修改配置后的初始化 gitlab-ctl reconfigure 啟動 sudo gitlab-ctl start 停止 sudo gitlab-ctl stop 重啟 sudo gitlab-ctl restart 開機啟動 systemctl enable gitlab-runsvdir.service 禁止開機自啟動 systemctl disable gitlab-runsvdir.servicesystemctl list-unit-files | grep gitlab gitlab-runsvdir.service enabled修改重要的配置文件: /etc/gitlab/gitlab.rb
修改訪問的的路徑,端口可加可不加,不加時在瀏覽器訪問不需要添加端口系統(tǒng)默認請求路徑 external_url 'http://127.0.0.1' external_url 'http://127.0.0.1:8080' 時間區(qū)域 gitlab_rails['time_zone'] = 'Asia/Shanghai' 數(shù)據(jù)存儲位置git_data_dirs({"default" => {"path" => "/data/git-data"}})修改了配置文件一定要執(zhí)行:gitlab-ctl reconfigure
修改密碼
登錄成功后可以在右上角頭像 >> edit profile >> Password里面修改密碼。
修改中文
登錄成功后可以在右上角頭像 >> preferences >> Localization >> Language選擇簡體中文
數(shù)據(jù)備份:
gitlab創(chuàng)建備份 1、創(chuàng)建備份文件,首先進行老服務(wù)器上的gitlab備份,使用下方命令 gitlab-rake gitlab:backup:create備份之后我的備份包還在 gitlab_rails['backup_path'] = "/home/gitbackups" 下, 因為我在配置文件中已自定義,若無修改,則默認備份到 /var/opt/gitlab/backups 目錄下gitlab備份恢復(fù) 1、將老服務(wù)器上的備份包拷貝一份到新服務(wù)器的 gitlab_rails['backup_path'] = “/home/gitbackups”下, 你配置文件中寫的什么位置,拷貝過來的包就放在什么位置,并在新服務(wù)器上給其設(shè)置 777 權(quán)限, 避免恢復(fù)過程中某些插件權(quán)限不夠的情況。 chmod 777 xxxxxx.tar2、執(zhí)行命令停止相關(guān)數(shù)據(jù)連接服務(wù) gitlab-ctl stop unicorn gitlab-ctl stop sidekiq3、備份恢復(fù) gitlab-rake gitlab:backup:restore BACKUP=備份文件編號 例如:我的備份包為 1618941697_2021_04_21_13.1.2_gitlab_backup.tar,那么備份文件編號就為 1618941697_2021_04_21_13.1.2,選整個文件名稱沒用。gitlab-rake gitlab:backup:restore BACKUP=1618941697_2021_04_21_13.1.2 在恢復(fù)過程中會遇到兩個交互界面,都輸入 yes,之后就會安裝成功。建議一下操作:
操作性的導(dǎo)出數(shù)據(jù)
選中項目,點擊進去,然后點擊 Settings -> 進入后會默認進入到General 頁面,選擇 Advanced 的 Expand 按鈕進行點擊
->點擊展開后的 Export project 按鈕 ->點擊后,又會變成之前剛進入的樣子,這時再次點擊 Advanced 的 Expand
->這時展開后還是顯示的是 Export project,這次我們點擊左側(cè)的 General
->再次點擊 Advanced 的 Expand ->這時就會出現(xiàn) Download export,按鈕,點擊后就能進行下載操作。
操作性的導(dǎo)入數(shù)據(jù)
新建項目 -> 導(dǎo)入項目 -> GitLab導(dǎo)入 ->導(dǎo)入一個從GitLab導(dǎo)出的項目 -> 如需將整個GitLab項目從另一個GitLab服務(wù)器移動或復(fù)制到此服務(wù)器,請訪問原項目的設(shè)置頁面,生成導(dǎo)出文件,然后在此處上載。GitLab項目導(dǎo)出
填寫相關(guān)項目名就可以了
總結(jié)
以上是生活随笔為你收集整理的gitlab-ce搭建和数据迁移的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 度量衡计算工具_在线度衡量转换器
- 下一篇: python爬取分页数据_爬虫抓取分页数