Last active
April 7, 2022 05:04
-
-
Save tyl1996/b9cd7324c52f4f229d1a9e83e9e54f15 to your computer and use it in GitHub Desktop.
GitLab 설치 도전기
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 환경 | |
- AWS 인스턴스 | |
- MobaXTerm으로 SSH 접근 | |
- Xeon E5-2676 2.4Ghz 4GB RAM 80GB SSD | |
- Nginx (80, 443 포트 사용 중, LetsEncrypt SSL 적용) | |
- Docker | |
- 신규 생성된 유저(docker 권한 得) https://thedijje.medium.com/create-a-passwordless-user-with-pem-file-for-ubuntu-aws-ec2-e683fdb43394 | |
## 설치방법 | |
- https://docs.gitlab.com/ee/install/docker.html | |
- Install GitLab using Docker Engine | |
## 오류 | |
### 서버 응답이 없음 | |
- ssh 접근이 중단되고 연결되지 않음 | |
- 기존 되던 80, 443 포트 연결되지 않음 | |
- 이유는 GitLab 도커 컨테이너가 호스트의 모든 리소스(CPU, Memory) 점유 | |
- 해결법은 `docker run` 명령에 cpu, memory 제한을 걸면 됨 | |
- https://docs.docker.com/config/containers/resource_constraints/ | |
``` | |
docker run --detach --hostname gitlab.example.com --publish 8929:443 --publish 8928:80 --publish 2289:22 --memory="2.5g" --cpus="1" --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GITLAB_HOME/data:/var/opt/gitlab --shm-size 256m gitlab/gitlab-ee:latest | |
``` | |
### 포트 번호 | |
- | |
### 502-Whoops, GitLab is taking too much time to respond | |
- 아주 자주 뜨며, 간혹 정상적으로 접근이 되는 경우가 있었음 | |
- | |
https://forum.gitlab.com/t/502-whoops-gitlab-is-taking-too-much-time-to-respond/52522/13 | |
# 환경 | |
- WSL Ubuntu에서 설치 | |
- 도커에서 하는 것이 안전하겠지만, 그만큼 더 많은 리소스를 사용할 것 같아 보류(호스트-도커-우분투-도커-깃랩) | |
## WSL Ubuntu 설치 | |
- wsl 설치 | |
- 스토어에서 우분투 설치 | |
- 실행(접근시 자동 켜짐, 스토어에서 다운받은 앱 실행도 가능) | |
- 메모리 점유 등으로 종료 원하는 경우 호스트에서 `wsl -t <distro-name>` | |
https://docs.microsoft.com/ko-kr/windows/wsl/basic-commands | |
## 도커 설치 | |
https://docs.docker.com/engine/install/ubuntu/ | |
하지만 마지막에 `Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?` 에러 발생 | |
`sudo service docker start`로 해결 | |
https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker | |
## 깃랩설치 | |
https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-engine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MariaDB 설치
도커 이미지 활용: https://hub.docker.com/_/mariadb
$ docker run --detach --name some-mariadb --env MARIADB_USER=example-user --env MARIADB_PASSWORD=my_cool_secret --env MARIADB_ROOT_PASSWORD=my-secret-pw mariadb:latest
도커 이미지 접속하여 데이터베이스 생성
$ docker exec -it some-mariadb mysql -p
후 비밀번호 입력CREATE DATABASE checksource
https://mariadb.com/kb/en/create-database/
USE checksource
DBeaver(혹은 Workbench 등 DB 툴)로 접속시 오류
https://stackoverflow.com/questions/59577312/mariadb-cannot-connect-to-mariadb-instance-from-dbeaver-using-correct-password