GitLab 설치 및 기타 에러 대응.

2024. 7. 12. 16:15깃랩

반응형

회사에서 SVN에서 GIT으로 이관하기위해 GitLab이 필요하여 설치하는 작업이 있었기에 정리한다.

설치 참고주소(공식 사이트)

https://about.gitlab.com/install/#centos-7

 

Download and install GitLab

Download, install and maintain your own GitLab instance with various installation packages and downloads for Linux, Kubernetes, Docker, Google Cloud and more.

about.gitlab.com

 

필수 라이브러리 설치

open HTTP, HTTPS and SSH 그리고 firewall 방화벽 처리 하는 부분이 포함되어 있음.

sudo yum install -y curl policycoreutils-python openssh-server perl
# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd
# Check if opening the firewall is needed with: sudo systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

Email 발송하는 경우 설치.(필수아님)

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

Gitlab Repo 추가.

###패키지 지정시 설치 방법
curl <https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh> | sudo bash
sudo yum install gitlab-ee

### 설치 하며 접근주소 변경까지 한번에 하는법
sudo EXTERNAL_URL="" yum install -y gitlab-ee

설치 완료시 모습은 다음과 같다.

깃랩 설치 모습

접근주소 변경

/etc/gitlab/gitlab.rb 파일을 열어서 external_url 을 변경 합니다.

### 해당 url 은 웹에서 접속할 URL 설정입니다. 
external_url 'http://서버주소'

GitLab 명령어 및 수정 반영

gitlab-ctl reconfigure 명령을 통해 환경파일을 재구성 하고 Gitlab 을 재시작 합니다.
/etc/gitlab/gitlab.rb 파일이 변경 되었다면 gitlab-ctl reconfigure 명령을 수행해야만 적용이 됩니다.

  • gitlab-ctl reconfigure :gitlab 변경 파일 재구성및 재기동
  • gitlab-ctl stop :gitlab 중지
  • gitlab-ctl start :gitlab 시작
  • gitlab-ctl restart :gitlab 재시작
##gitlab 변경 파일 재구성 및 재기동
gitlab-ctl reconfigure 
##gitlab 중지
gitlab-ctl stop
##gitlab 시작
gitlab-ctl start 
##gitlab 재시작
gitlab-ctl restart 
##gitlab 상태확인
gitlab-ctl status
##에러로그 확인
gitlab-ctl tail

gitlab-ctl status 명령으로 현재 gitlab 상태를 확인 합니다.

GitLab 삭제를 하는 경우

sudo gitlab-ctl cleanse
sudo gitlab-ctl uninstall
sudo apt remove gitlab-ee
sudo apt purge gitlab-ee
 
 
rm -rf  /opt/gitlab 
rm -rf  /var/opt/gitlab 
rm -rf  /etc/gitlab 
rm -rf  /var/log/gitlab

다음과 같이 에러가 발생하는 경우

502에러 모습

 

tail명령어를 이용하여 확인해본 결과 puma 실행포트가 겹쳤다는 에러가 보였기에 다음과같이 수정 후 재적용해 주었다.

puma의 경우 default 8080 → 9005로 변경해보았다.

아래 사이트 참고함.

https://velog.io/@yange/Gitlab

 

Gitlab에 대하여

GitLab에는 두 가지 고유한 제품이 있다.알림 이메일을 보내기 위해 Postfix를 설치GitLab CE 패키지 저장소 추가GitLab CE 패키지를 설치GitLab 재구성 스크립트를 실행

velog.io

추가 작업

그래도 여전히 502 에러가 발생하여 다음과 같이 변경하였다.

vim /etc/gitlab/gitlab.rb

해당 내용중에 NGINX 의 다음부분만 적용 시켰다.

그리고 재시작 수행

gitlab-ctl reconfigure

 

기타 에러 발생

gitlab-ctl reconfigure 시도중에 멈춰서 동작하지 않는 형태로 있길래 상태를 확인해보려고 하였다.
그러나 다음과 같이 warning이 발생하였고, 이부분을 해결하니 정상적으로 동작하더라.

에러발생 참고블로그

https://joelweon.github.io/2021/08/31/gitlab-install.html

 

WSL에서 gitlab 설치하기

WSL에서 gitlab 설치하기 31 Aug 2021 install gitlab in WSL Ubuntu20.04LTS sudo apt-get update sudo apt-get install -y curl openssh-server ca-certificates Gitlab repository 추가 후 설치 curl https://packages.gitlab.com/install/repositories/gitlab/

joelweon.github.io

 

GitLab설치 참고주소 블로그

https://growupcoding.tistory.com/66

 

[GitLab] GitLab 설치 방법 및 환경설정

GitLab 설치 버전 확인 Ubuntu 20.04.4 LTS 버전에서 에서 GitLab 설치하는 방법에 대해 알아보겠습니다. 설치는 우분투 공식 홈페이지 자료를 이용해 설치 하는 내용을 담아 보겠습니다. 우분투 GiltLab 설

growupcoding.tistory.com

 

반응형

'깃랩' 카테고리의 다른 글

SVN에서 GitLab으로의 전환 그리고 GitHub  (0) 2024.07.12