06 Nexus Warehousing/Infrastructure - The Road to DevOps

06 Nexus Warehousing/Infrastructure - The Road to DevOps

Article Github address, welcome start: https://github.com/li-keli/DevOps-WiKi

Nexus Warehousing official website introduction:

The world's first and only universal repository solution that's FREE to use.

official documentation

2018-04-10_2.06.png

nexus

As can be seen from the above figure, Repository3 currently supports mainstream Maven、npm、Nuget、Docker、PyPl、Bower, which shows that the functions of the repository are comprehensive and powerful.

installation method

  • Official binary distribution package installation
  • docker image

Official binary distribution package installation

Download source code

curl -# -O http://download.sonatype.com/nexus/3/latest-unix.tar.gz && \
tar -zxvf latest-unix.tar.gz && \
mv nexus-3.10.0-04 /opt

Directory Description

nexus
├── bin             # 该目录包含nexus启动脚本本身以及启动相关的配置文件
├── deploy          
├── etc             # 该目录包含配置文件
├── lib             # 该目录包含与Apache Karaf相关的二进制库
├── LICENSE.txt     
├── NOTICE.txt      
├── public          # 该目录包含应用程序的公共资源
└── system          # 该目录包含构成应用程序的所有组件和插件

Install the Java runtime

yum install java-1.8.0-openjdk.x86_64 -y && \
java -version

Configuration Environment

Add variables to .bashrc

export NEXUS_HOME="/opt/nexus"

Create a soft link

ln -s $NEXUS_HOME/bin/nexus /etc/init.d/nexus

chkconfig

cd /etc/init.d && \
chkconfig --add nexus && \
chkconfig --levels 345 nexus on && \
systemctl start nexus.service

Started successfully

Create boot

sudo cat>/usr/lib/systemd/system/nexus.service<<EOF
[Unit]  
Description=nexus  
After=network.target  
  
[Service]  
Type=forking  
ExecStart=/opt/nexus/bin/nexus/bin/nexus start  
ExecReload=/opt/nexus/bin/nexus/bin/nexus stop  
ExecStop=/opt/nexus/bin/nexus/bin/nexus stop  
PrivateTmp=true  
  
[Install]    
WantedBy=multi-user.target  
EOF && \
systemctl enbale nexus

Other remarks

After the service is started, the default port number: 8081, which can be configured by modification /opt/nexus/etc/nexus-default.properties.

http://***:8081/

Default login account passwordadmin/admin123

firewall

open default 8081port

firewall-cmd --permanent --add-port=8081/tcp && \
firewall-cmd --reload

Check for open ports

firewall-cmd --zone=public --list-ports

In addition, due to the limited knowledge of the author himself, he is all groping, so not all practices are correct, or some practices will have better solutions. I hope readers will correct me. If you have any questions, please leave issues .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325077125&siteId=291194637