본문 바로가기

기타/Linux

[우분투] Ubuntu 20.04 Gitlab IP 주소 변경하기

Ubuntu 20.04 Gitlab IP 주소 변경하기

깃랩 서버 IP 주소 바꾸기

Gitlab 서버 IP 주소를 변경하였다면!

Gitlab 서버 IP 주소를 바꾸고, 아무런 조치를 취하지 않았다면 아래와 같은 timed out 가 발생한다.

$ git clone git@이전IP주소:test/example.git
Cloning into 'example'...
ssh: connect to host 이전IP주소 port 22: Connection timed out
fatal: Could not read from remote repository.

Gitlab 서버 IP 주소 변경 방법

Gitlab 서버 에 접속하여 sudo 권한으로 /etc/gitlab/gitlab.rb 를 수정한다.

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'http://192.168.219.104'

그리고, gitlab 설정을 다시 로딩한다.

sudo gitlab-ctl reconfigure

참고자료

https://docs.gitlab.com/omnibus/settings/configuration.html

 

Configuration options | GitLab

Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.

docs.gitlab.com