0% found this document useful (0 votes)
98 views

Nexus Notes Session-01

Nexus is an open source artifact repository manager from Sonatype that stores and distributes artifacts needed for development. It provides consistency to continuous integration and continuous development workflows by managing artifacts in a central location. This saves development teams time and increases build performance compared to inconsistent local artifact storage. Nexus can be installed on an Amazon EC2 Linux server by installing Java, downloading and extracting the Nexus package, configuring permissions for the Nexus user, and starting the Nexus service.

Uploaded by

SUDHAN R
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

Nexus Notes Session-01

Nexus is an open source artifact repository manager from Sonatype that stores and distributes artifacts needed for development. It provides consistency to continuous integration and continuous development workflows by managing artifacts in a central location. This saves development teams time and increases build performance compared to inconsistent local artifact storage. Nexus can be installed on an Amazon EC2 Linux server by installing Java, downloading and extracting the Nexus package, configuring permissions for the Nexus user, and starting the Nexus service.

Uploaded by

SUDHAN R
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction

Nexus is a Open source, Jave based, Artifact repository manager by Sonatype that
organizes, stores and distributes artifacts needed for development. 

What is an artifact repository?


An artifact repository is a software application designed to manage these artifacts. Using
an artifact repository provides consistency to your Continuous Integration/Continuous
Development (CI/CD) workflow. It saves teams time and increases build performance.

List of Top 10 Repository Management DevOps Tools


JFrog Artifactory  By Jfrog
Sonatype Nexus  By Sanatype
Cloudsmith Package
Pulp
NuGet
MyGet
npm
Docker Hub

Diff between GitHub and Nexus


There are both referential:

 one (Git) is a source referential for version control (with features like merging, branching, tags)
 the other (Nexus) is an artifact referential for any delivery (binaries or not)

The referential database differs also:

 Git has its own internal repository storage mechanism


 Nexus is simply a collection of shared directories with a naming convention
( group.artifact.version ).

Java  jar, war, ear files


Docker  Docker images
Node Js  tar
Redhat  rpm
These packages are stored in Nexus and are easily retrived when needed.
Nexus installation Amazon Elastic Compute Cloud (Amazon EC2)

1. Create a new instance : t2 medium and connect to git bash

2. Install Java in Linux Server


##Login as a root user
sudo su -

##Change dir to /opt 


cd /opt
yum install wget -y
wget -c --header "Cookie: oraclelicense=accept-securebackup-
cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/
d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

yum install jdk-8u131-linux-x64.rpm -y


java -version

3. Nexus Server installation in Linux Server


Login as a root user

sudo su -
cd /opt
yum install tar wget –y
 wget https://download.sonatype.com/nexus/3/nexus-3.40.1-01-unix.tar.gz

 tar -zxvf nexus-3.40.1-01-unix.tar.gz Note:(tar –zxvf  for gzip file)

Rename the nexus-3.40.1-01 to nexus

mv /opt/nexus-3.40.1-01 /opt/nexus

#As a good security practice, Nexus is not advised to run nexus service as a root user, so
create a new user called nexus and grant sudo access to manage nexus services as
follows.
 
useradd nexus

#Give the sudo access to nexus user

visudo
nexus ALL=(ALL) NOPASSWD: ALL

#Change the owner and group permissions to /opt/nexus and /opt/sonatype-work directories.

chown -R nexus:nexus /opt/nexus


chown -R nexus:nexus /opt/sonatype-work

chmod -R 775 /opt/nexus


chmod -R 775 /opt/sonatype-work
#Open /opt/nexus/bin/nexus.rc file and  uncomment run_as_user parameter and set as
nexus user.

vi /opt/nexus/bin/nexus.rc
run_as_user="nexus"

#Create nexus as a service

ln -s /opt/nexus/bin/nexus /etc/init.d/nexus

#Switch as a nexus user and start the nexus service as follows.


su - nexus

#Enable the nexus services


sudo systemctl enable nexus

#Start the nexus service


sudo systemctl start nexus

Troubleshooting
---------------------
nexus service is not starting?

a)make sure need to change the ownership and group to /opt/nexus and /opt/sonatype-work
directories and permissions (775) for nexus user.
b)make sure you are trying to start nexus service with nexus user.
c)check java is installed or not using java -version command.
d) check the nexus.log file which is availabe in  /opt/sonatype-work/nexus3/log  directory.
#Access the Nexus server from Laptop/Desktop browser.
http://IPAddess/Hostname:8081/  Nexus 3
http://IPAddess/Hostname:8081/  Nexus 2

#Default Credentials
User Name: admin
Password: Password will be dynamic & it will be available in directory while signning In

New Password : admin123

Loged in as admin user:


Note: Even without Sign In we can access default repositories:

How to disable the Anonymous Access before Sign in ??


Sign In as admin user  Settings  Security  Anonymous Access  Uncheck

---------------------------------------------------------------------------------------------------------------------

Note: Deafault Port Numbers:


Tomcat / Jboss / Wildfly / Jenkins  8080
Jfrog Artifactory / Nexus  8081
SonarQube  9000
MySQL  3306

---------------------------------------------------------------------------------------------------------------------

Nexus Directory structure

The installation directory having below directories:


bin
deplo
y etc
lib
public
syste
m

bin: contains the nexus startup script itself as well as startup-related configuration files.
etc: contains configuration files.
lib: contains binary libraries related to Apache Karaf.
public: contains public resources of the application.
system: contains all components and plugins that constitute the application.
Data Directory
The data directory, found by default at ../sonatype-work/nexus3, includes subdirectories
that contain all the components, repositories, configurations and other data presented by the
repository manager. The subdirectories are listed as:
blobs/
This is the default location of the blob store. If you provided a fully qualified path
when creating a new blob store, it may not end up in this directory.
cache/
This directory contains information on currently cached Karaf bundles
db/
This directory contains the OrientDB databases which are the primary storage for your repository
manager’s metadata
elasticsearch/
This directory contains the currently configured state of Elasticsearch
etc/
This directory contains the main runtime configuration and customization of the
repository manager. The files are explained further in Configuring the Runtime
Environment.
health-check/
This directory contains cached reports from the Repository Health Check feature
keystores/
This contains the automatically generated key used to identify your repository manager
log/
This directory contains several log files that capture information about various aspects of
the running repository manager. The nexus.log and request.log files are rotated every day so
this directory also contains archived copies of these files. To reclaim disk space, you can
delete old log files from the logs directory. Log files found in this directory include:

nexus.log - The main repository manager application log. Log messages contain standard log
output fields including date/time, log level, the associated thread, class and message.
request.log - Used to log http access requests to a running repository manager. Log messages
contain information such as client host, user and HTTP request attributes including status
code, bytes, and user-agent header.
jvm.log - Contains JVM stdout, stderr and thread dump messages

karaf.log - This is the Apache Karaf container log file which contains messages specific to the
repository manager startup

The log directory also contains a tasks subdirectory which contains separate, uniquely
named (by date, time and task name) log output files for each task that is run. See
Task Logging for more details concerning naming strategy and content of these files.
tmp/
This directory is used for temporary storage

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy