Cloud/Azure

[Azure/Linux] RHEL8.2 Nexus Repository 설치

tpcable 2021. 5. 28. 23:41

1. 설치를 위해 SELINUX 를 해제하고 시작

 

[root@nexusrepo azureadmin]# setenforce 0

[root@nexusrepo azureadmin]# vim /etc/selinux/config

2. dnf update 및 JDK 설치

[root@nexusrepo azureadmin]# dnf -y update

[root@nexusrepo azureadmin]# dnf -y install java-1.8.0-openjdk-devel.x86_64

 

3. JAVA 환경변수 설정

[root@repo azureadmin]# which java

/bin/java

[root@repo azureadmin]# readlink -f /bin/java

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.el8_2.x86_64/jre/bin/java

 

[root@repo azureadmin]# vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.el8_2.x86_64/jre/bin/java

[root@repo azureadmin]# source /etc/profile
[root@repo azureadmin]# echo $JAVA_HOME

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.el8_2.x86_64/jre/bin/java

 

 

4. Nexus Repo 설치 및 사용자 생성(root로 실행 하지 않기 위한)

[root@nexusrepo azureadmin]# useradd nexus

[root@nexusrepo azureadmin]# passwd nexus

[nexus@repo ~]$ pwd

/home/nexus

[nexus@repo ~]$ wget http://www.sonatype.org/downloads/nexus-latest-bundle.tar.gz --no-check-[nexus@repo ~]$ tar zxvf nexus-latest-bundle.tar.gz

 

5. systemd 서비스 파일 등록

[root@repo ~]$ vim /etc/systemd/system/nexus.service

[Unit]

Description=nexus service

After=network.target

 

[Service]

Type=forking

ExecStart=/home/nexus/nexus-2.14.20-02/bin/nexus start

ExecStop=/homwe/nexus/nexus-2.14.20-02/bin/nexus stop

User=nexus

Restart=on-abort

 

[Install]

WantedBy=multi-user.target

 

 

6. tcp 8081 방화벽 추가

[root@repo nexus]# firewall-cmd --zone=public --permanent --add-port=8081/tcp

success

 

[root@repo nexus]# firewall-cmd --reload 

success

 

7. 서비스 기동

[root@repo nexus]# systemctl daemon-reload

[root@repo nexus]# systemctl start nexus.service 

[root@repo nexus]# systemctl enable nexus.service 

Created symlink /etc/systemd/system/multi-user.target.wants/nexus.service → /etc/systemd/system/nexus.service.

 

[root@repo nexus]# systemctl status nexus.service 

 

8. 서비스 확인 

동일 네트워크에서 접속

http://<host>:8081/nexus

 

 

 

9. 초기 계정정보 admin / admin123