How To Install Latest Sonatype Nexus 3 On Linux
2018-01-21 23:03
302 查看
Sonatype Nexus is one of the best repository managers out there. It is some tool that you cannot avoid in your CI/CD pipeline. It effectively manages deployable artifacts.
Sonatype Nexus 3 On Linux Ec2
This article guides you to install and configure Sonatype Nexus 3 in a secure way on an ec2 Linux System.
Note: This was tested on a Redhat 7 machine and it will work on Centos 7 as well.
Step 1: Login to your Linux server and update it.
sudo yum update -y
Step 2: Install OpenJDK 1.8
sudo yum install java-1.8.0-openjdk.x86_64
Step 3: Create a directory named app and cd into the directory.
sudo mkdir /app && cd /app
Step 4: Download the latest nexus. You can get the latest download links fo for nexus from here. Here I am downloading nexus 3.
sudo wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.0.2-02-unix.tar.gz
Untar the downloaded file.
sudo tar -xvf nexus-3.0.2-02-unix.tar.gz
Rename the untared file to nexus.
sudo mv nexus-3.0.2-02 nexus
Step 5: As a good security practice, it is not advised to run nexus service with any sudo user. So create a new user named nexus.
sudo adduser nexus
Change the ownership of nexus file to nexus user.
sudo chown -R nexus:nexus /app/nexus
Open /app/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.
run_as_user=”nexus”
Step 6: If you want to change the default nexus data directory, open nexus properties file and change the data directory “-Dkaraf.data” parameter to a preferred location as shown below.
sudo vi /app/nexus/bin/nexus.vmoptions
An example configuration is shown below.
-Xms1200M
-Xmx1200M
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Djava.net.preferIPv4Stack=truer
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc
-Djava.util.logging.config.file=etc/java.util.logging.properties
-Dkaraf.data=/nexus/nexus-data
-Djava.io.tmpdir=data/tmp
-Dkaraf.startLocalConsole=false
Running Nexus As A Service
It is better to have a init.d entry to manage nexus service using the Linux service command. Follow the steps given below for the setup.
Step 1: Create a symbolic link for nexus service script to /etc/init.d folder.
sudo ln -s /app/nexus/bin/nexus /etc/init.d/nexus
Step 2: Execute the following commands to add nexus service to boot.
sudo chkconfig –add nexus
sudo chkconfig –levels 345 nexus on
Manage Nexus Service
Now we have all the configurations in place. To start the Nexus service, use the following command.
sudo service nexus start
The above command will start the nexus service on port 8081. To access the nexus dashboard, visit http://:8081. You will be able to see the nexus homepage as shown below.
How to Install Nexus 3 (2)
To log in, use the default username and password.
User Name: admin
Password: admin123
For stopping,
sudo service nexus stop
For restarting,
sudo service nexus restart
———————-
This article was originally published by Bibin Wilson on DevOpsCube.com
The following two tabs change content below.
Sonatype Nexus 3 On Linux Ec2
This article guides you to install and configure Sonatype Nexus 3 in a secure way on an ec2 Linux System.
Note: This was tested on a Redhat 7 machine and it will work on Centos 7 as well.
Step 1: Login to your Linux server and update it.
sudo yum update -y
Step 2: Install OpenJDK 1.8
sudo yum install java-1.8.0-openjdk.x86_64
Step 3: Create a directory named app and cd into the directory.
sudo mkdir /app && cd /app
Step 4: Download the latest nexus. You can get the latest download links fo for nexus from here. Here I am downloading nexus 3.
sudo wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.0.2-02-unix.tar.gz
Untar the downloaded file.
sudo tar -xvf nexus-3.0.2-02-unix.tar.gz
Rename the untared file to nexus.
sudo mv nexus-3.0.2-02 nexus
Step 5: As a good security practice, it is not advised to run nexus service with any sudo user. So create a new user named nexus.
sudo adduser nexus
Change the ownership of nexus file to nexus user.
sudo chown -R nexus:nexus /app/nexus
Open /app/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.
run_as_user=”nexus”
Step 6: If you want to change the default nexus data directory, open nexus properties file and change the data directory “-Dkaraf.data” parameter to a preferred location as shown below.
sudo vi /app/nexus/bin/nexus.vmoptions
An example configuration is shown below.
-Xms1200M
-Xmx1200M
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Djava.net.preferIPv4Stack=truer
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc
-Djava.util.logging.config.file=etc/java.util.logging.properties
-Dkaraf.data=/nexus/nexus-data
-Djava.io.tmpdir=data/tmp
-Dkaraf.startLocalConsole=false
Running Nexus As A Service
It is better to have a init.d entry to manage nexus service using the Linux service command. Follow the steps given below for the setup.
Step 1: Create a symbolic link for nexus service script to /etc/init.d folder.
sudo ln -s /app/nexus/bin/nexus /etc/init.d/nexus
Step 2: Execute the following commands to add nexus service to boot.
sudo chkconfig –add nexus
sudo chkconfig –levels 345 nexus on
Manage Nexus Service
Now we have all the configurations in place. To start the Nexus service, use the following command.
sudo service nexus start
The above command will start the nexus service on port 8081. To access the nexus dashboard, visit http://:8081. You will be able to see the nexus homepage as shown below.
How to Install Nexus 3 (2)
To log in, use the default username and password.
User Name: admin
Password: admin123
For stopping,
sudo service nexus stop
For restarting,
sudo service nexus restart
———————-
This article was originally published by Bibin Wilson on DevOpsCube.com
The following two tabs change content below.
相关文章推荐
- How to install the latest Nvidia drivers on Ubuntu 14.04 Trusty Tahr
- How to install latest mysql 5.6 on CentOS7
- How to install/setup latest version of PHP 5.5 on Ubuntu 12.04 LTS (Precise Pangolin)
- How to install jdk 1.7 on Linux
- [未完待续]对安装CCMake的一点理解(how to install the latest version of ccmake)
- How to Install the Latest Nvidia Driver on Ubuntu 12.04
- How to Install the Latest GCC on Windows
- How to Install the Latest Nvidia Driver on Ubuntu 12.04
- Centos Install SonaType Nexus
- How to install the latest Eclipse in Ubuntu 14+
- How to install latest Mac OS X Lion Virtual Machin
- How to install Maven on Mac OSX
- how-to-install-graphite-on-centos6.6-x86_64
- How to build a product with InstallShield
- How to Install Java JDK in Kali Linux
- How to Use Output-type Variable
- How to embed a True Type font( 转载 )
- How To Install Berkeley DB
- Maven私有库和本地库的安装与配置 Sonatype Nexus + Maven
- How to Install Zabbix 3.0 Beta on CentOS 6