SonarQube7.9 + PostgreSQL 설치 방법을 공유 합니다.
docker-compose로 진행합니다. (이제 컨테이너 아니면, 설치를 못ㅎ.. 😅)
$ sysctl -w vm.max_map_count=262144
$ sysctl -w fs.file-max=65536
$ ulimit -n 65536
$ ulimit -u 4096
1) 호스트 <-> 컨테이너 퍼머넌트(permanent) 생성
$ mkdir -p /app/sonarqube/conf
$ mkdir -p /app/sonarqube/data
$ mkdir -p /app/sonarqube/logs
$ mkdir -p /app/sonarqube/extensions
$ mkdir -p /app/sonarqube/postgres
$ chmod 777 /app/sonarqube -R
2) docker-compose.yml
생성
$ vi /work/sonarqube/docker-compose.yml
version: "3.1"
services:
sonarqube:
image: sonarqube:7.9.1-community
container_name: sonarqube7.9
ports:
- "9000:9000"
- "9092:9092"
networks:
- sonarnet
environment:
- SONARQUBE_HOME=/opt/sonarqube
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
- SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
volumes:
- /app/sonarqube/conf:/opt/sonarqube/conf
- /app/sonarqube/data:/opt/sonarqube/data
- /app/sonarqube/logs:/opt/sonarqube/logs
- /app/sonarqube/extensions:/opt/sonarqube/extensions
db:
image: postgres
container_name: postgres
networks:
- sonarnet
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- /app/sonarqube/postgres:/var/lib/postgresql/data
networks:
sonarnet:
driver: bridge
3) SonarQube 기동
$ cd /work/sonarqube
$ docker-compose up -d
1) 서비스 시작
$ docker-compose up -d
2) 실행 로그 확인
$ docker logs --tail 10 sonarqube7.9 # 로그의 마지막 10줄만 출력
3) SonarQube 로그인
http://<IP>:9000
접속 (admin / admin)
제일 위에 사전설치에 명령어들도 했는데
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
에러가 뜨네요ㅜㅜ
구글링해서 65536 으로 올렸는데도 계속 에러가 뜨네용..