환경: linux, jdk가 깔려 있어야 함 (java 기반으로 실행되기 때문)

sudo apt-get install openjdk-8-jre openjdk-8-jdk

 

 

1. nexus를 다운 받는다.

wget https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.26.1-02-unix.tar.gz

 

2. tar파일을 압축 해제한다.

tar -zxvf nexus-3.26.1-02-unix.tar.gz

3. 아래와 같이 환경 변수를 설정해한다.

NEXUS_HOME="/repository/nexus"

 

4. 넥서스에서 사용할 사용자를 추가한다. 

useradd [사용자 이름]

 

5. bin/nexus.rc 파일에 위에서 등록한 사용자 이름을 등록해야 한다.

run_as_user="[사용자 이름]"

 

6. /etc/systemd/system/에 nexus.service 파일 생성 후 아래와 같은 내용을 등록해줘야 한다. 

(ubuntu 16.04에서는 systemd로 관리하기 때문에 서비스로 사용하기 위해서)

[Unit]
Description=nexus service
After=network.target

[Service] Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install] WantedBy=multi-user.target

 

7. systemd daemon을 업데이트 후, nexus를 실행시킨다.

systemctl daemon-reload
systemctl enable nexus.service
systemctl start nexus.service

 

 8. 서비스의 상태를 확인한다.

systemctl status nexus

또는

tail -f ./sonatype-work/nexus3/log/x.log

'Nexus' 카테고리의 다른 글

인터페이스 http -> https 접근 가능하게 하기  (0) 2020.08.13

+ Recent posts