티스토리 뷰

Version Control

Install and Configure GitLab on CentOS8

out of coding 2020. 3. 15. 22:00

오늘은 제가 GitLab을 CentOS8에 설치하여 보려고 합니다.
무료인 CE 버전을 설치하여 보려고 합니다.

*중요 : 웬만하면 최소사양을 지켜주세요. 재부팅후 살아나는데 메모리가 부족해서 서버가 뜨질 않아요

2코어, 4G 이상을 추천 드립니다. 여기는 가이드... 제가 설치한것 이상이면 어차피 좋습니다.

https://github.com/jimmidyson/gitlab-ce/blob/master/doc/install/requirements.md

 

jimmidyson/gitlab-ce

Contribute to jimmidyson/gitlab-ce development by creating an account on GitHub.

github.com

설치는 여기에 다 있기는 합니다. 조금 다를수 있으니 봐주세요

https://about.gitlab.com/install/#centos-7?version=ce

 

 

Download and install GitLab

Learn about the various GitLab installation packages and downloads for Ubuntu, Debian, Docker, Google Cloud, and many more.

about.gitlab.com

1. 방화벽을 열어줍니다.

$ sudo firewall-cmd --permanent --add-service={ssh,http,https} --permanent
$ sudo firewall-cmd --reload

 

2. Update system and Install Dependencies

$ sudo yum -y update
$ sudo yum -y install curl vim policycoreutils python3-policycoreutils

 

메일로 Server Notification을 받고 싶다면 postfix도 설치하여 줍니다.

$ sudo yum -y install postfix

 

재실행시에도 postfix가 실행 될 수 있도록 설정하여 줍니다.

$ sudo systemctl enable postfix
$ sudo systemctl start postfix

 

3. regist gitlab package repository

$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

 

4. gitlab-ce install

$ EXTERNAL_URL="domain or IP:port" yum -y install gitlab-ce

 

저는 EXTERNAL_URL="http://192.168.0.1:8001" yum -y install gitlab-ce

5. 접속 url을 따로 변경하여 주고 싶을때는 이렇게 설정합니다.

$ sudo vi /etc/gitlab/gitlab.rb

 

안에 이 내용을 넣어줍니다.
external_url 'http://domain or IP:port'

 

6. 옵션을 조정합니다.

grafana['enable'] = false

이것을 안해주면 grafana를 사용하게 되어서 reconfigure하는데 시간이 너무 걸립니다.

7. reconfigure를 하여 줍니다.

$ sudo gitlab-ctl reconfigure

 

설정을 변경하였기 때문에 하여 줍니다.

 

8. port open
만약 위에서 포트를 8801로 열었다고 가정을 합니다.

$ sudo firewall-cmd --permanent --add-port=8001/tcp
$ sudo firewall-cmd --reload

9. 브라우저에 위에 넣은 주소를 쳐봅니다.

192.168.7.1:8001

password 변경 화면이 뜨면 정상입니다.


10. reconfigure는 설정을 바꾸었을 때만...

$ sudo gitlab-ctl start
$ sudo gitlab-ctl stop
$ sudo gitlab-ctl restart

 

11. error 해결

Error executing action `create` on resource 'account[GitLab user and group]'

 

* 이미 git이라는 계정을 사용하고 있어서 생기는 문제 입니다.
해결 방법은
user['username'] = "gitlab"
user['group'] = "gitlab"


12. Remove

$ sudo gitlab-ctl uninstall
$ sudo gitlab-ctl cleanse
$ sudo gitlab-ctl remove-accounts
$ sudo yum -y remove gitlab-ce

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함