2024. 7. 12. 16:15ㆍ깃랩
회사에서 SVN에서 GIT으로 이관하기위해 GitLab이 필요하여 설치하는 작업이 있었기에 정리한다.
설치 참고주소(공식 사이트)
https://about.gitlab.com/install/#centos-7
필수 라이브러리 설치
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
다음과 같이 에러가 발생하는 경우
tail명령어를 이용하여 확인해본 결과 puma 실행포트가 겹쳤다는 에러가 보였기에 다음과같이 수정 후 재적용해 주었다.
puma의 경우 default 8080 → 9005로 변경해보았다.
아래 사이트 참고함.
https://velog.io/@yange/Gitlab
추가 작업
그래도 여전히 502 에러가 발생하여 다음과 같이 변경하였다.
vim /etc/gitlab/gitlab.rb
해당 내용중에 NGINX 의 다음부분만 적용 시켰다.
그리고 재시작 수행
gitlab-ctl reconfigure
기타 에러 발생
gitlab-ctl reconfigure 시도중에 멈춰서 동작하지 않는 형태로 있길래 상태를 확인해보려고 하였다.
그러나 다음과 같이 warning이 발생하였고, 이부분을 해결하니 정상적으로 동작하더라.
에러발생 참고블로그
https://joelweon.github.io/2021/08/31/gitlab-install.html
GitLab설치 참고주소 블로그
https://growupcoding.tistory.com/66
'깃랩' 카테고리의 다른 글
SVN에서 GitLab으로의 전환 그리고 GitHub (0) | 2024.07.12 |
---|