1.バックアップ
バックアップとリカバリの操作の詳細については、他のブログGitlab Backup and Recoveryを参照してください。
アップグレードを開始する前に、必ずバックアップを作成し、バージョン番号を記録してください。
1.Gitlabの現在のバージョン番号を確認します
[root@gitlab ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
9.2.2
2.現在のGitlabをバックアップします
gitlab-rake gitlab:backup:create
バックアップファイルは、/ var / opt / gitlab / backupsの下に次のように生成されます:1557218709_2019_05_07_9.2.2_gitlab_backup.tar、ここで1557218709はバックアップのバージョン番号です。
2、アップグレード
注:Gitlabのアップグレードはメジャーバージョン番号にまたがることができないため、次のメジャーバージョン番号にアップグレードする前に、現在のメジャーバージョン番号から最高バージョンにのみアップグレードできます。
現在のバージョン番号は9.2.2なので、最新バージョン11.10.4にアップグレードしたいと思います。アップグレード手順は次のとおりです
。9.2.2—> 9.5.9—> 10.8.7—> 11.10.41
。準備します。関連するrpmパッケージ
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.8.7-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.10.4-ce.0.el7.x86_64.rpm
2.以下の手順に従って、ステップバイステップでアップグレードします。インストールの各ステップが成功した後、インターフェイス500が見つかった場合、これは、redisおよびその他のプログラムが完全に開始されていないためです。しばらく待ってからアクセスしてください。(次のアップグレード命令を実行する前に、データに正常にアクセスできることを確認してください)
yum localinstall -y gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-10.8.7-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-11.10.4-ce.0.el7.x86_64.rpm
完了後、現在のバージョンを確認してください。
[root@gitlab ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
11.10.4
この時点で、Gitlabのアップグレードが完了しました。急いで、新しいバージョンを体験してください。!
gitlabウェアハウスの保存場所を変更します
デフォルトのウェアハウス保管場所を変更する場合、GitLabウェアハウス保管場所は「/ var / opt / gitlab / git-data / repository」です。実際の本番環境では、明らかにこの場所に保管しません。通常、分割します。ストレージ用の別のパーティション。ウェアハウスデータの場合、ここの「/ data / git-data」ディレクトリにデータを保存する予定です。
root @ test1:〜/ tools#mkdir -pv / data / git-data
mkdir:作成されたディレクトリ "/ data"
mkdir:作成されたディレクトリ "/ data / git-data"
root @ test1:〜#chown -Rgit。git / data / git-data
#作成したディレクトリの所有者とグループをgit user root @ test1:〜/ tools#cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb.bak
root @ test1:〜に変更します/ tools#vim /etc/gitlab/gitlab.rb#git_data_dirs
パラメーターを有効にして、次のように変更します
。git_data_dirspath "/ data / git-data"
git_data_dirs({ "default" => { "path" => "/ data / git-data"、 "failure_count_threshold" => 10、 "failure_wait_time" => 30、 "failure_reset_time" => 1800、 "failure_timeout" => 30 } })
#そしてexternal_urlの値を計画されたアクセスドメイン名に変更します
external_url'http
://test.gitlab.net ' root @ test1:〜/ tools#gitlab-ctl reconfigure#gitlab.rbファイルを再コンパイルし、変更を使用して取得します
再び効果 編集後、GitLabは次のようにウェアハウスディレクトリにリポジトリファイルを自動的に作成します:
root @ test1:〜#ls -ld / data / git-data / repository /
drwxrws --- 2 git git 4096 1月4日14: 15 / data / git-data / repository /
GITLABのデフォルトポートを変更する
端口要用9090以后的最好,否则不生效
默认情况下:unicorn会占用8080端口,nginx会占用80端口。改完之后,就可以通过nginx[‘listen_port’] 在浏览器进行访问了。
内部8080端口也不再被占用了。
修改 /etc/gitlab/gitlab.rb 文件如下,然后执行重新配置,重启命令后完成。
gitlab-ctl reconfigure //让配置生效,重新执行此命令时间也比较长
gitlab-ctl restart
GITLABがrunsvnorunningを開始できないという問題を解決します
あなたは最初にそれを試すことができます
systemctl start gitlab-runsvdir.service
フリーズした場合は、システムサービス項目を確認する必要があります
systemctl -t target
システムが正常な場合は、すべてのタスクをアクティブアクティブでロードする必要があります。非アクティブなデッドオプションがある場合は、一部のサービスが正常に機能していないことを意味します。
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cloud-config.target loaded active active Cloud-config availability
cloud-init.target loaded active active Cloud-init target
cryptsetup.target loaded active active Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Network (Pre)
network.target loaded active active Network
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target loaded active active Paths
remote-fs-pre.target loaded active active Remote File Systems (Pre)
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
time-sync.target loaded active active System Time Synchronized
timers.target loaded active active Timers
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
22 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
multi-user.target loaded inactive dead start Multi-User System
今回使用する
systemctlリスト-ジョブ
実行中のタスクがある場合、それは他のすべてのサービスをブロックするタスクです。
1 graphical.target start waiting
107 plymouth-quit-wait.service start running
2 multi-user.target start waiting
169 ureadahead-stop.timer start waiting
121 gitlab-runsvdir.service start waiting
151 system-getty.slice start waiting
31 setvtrgb.service start waiting
122 systemd-update-utmp-runlevel.service start waiting
この時点で、systemctl stopplymouth-quit-wait.serviceを使用してタスクを終了できます。
次に、gitlabを再起動します。
GitLabをアンインストールします
- gitlabを停止します
gitlab-ctl stop
- 1
- アンインストールして、gitlabのバージョンがceまたはeeかどうかを確認します
rpm -e gitlab-ce
- プロセスを強制終了します
ps -ef|grep gitlab //查看进程
図にマークされているプロセスを強制終了します
kill -9 2287
- gitlabファイルを削除します
find / -name *gitlab*|xargs rm -rf
find / -name gitlab |xargs rm -rf
- ルートの下にバックアップされたファイルを削除し、最初に確認します
ls /root/gitlab*
削除する必要がない場合は削除します
これはアンインストールされます!