Nexus Notes Session-01
Nexus Notes Session-01
Nexus is a Open source, Jave based, Artifact repository manager by Sonatype that
organizes, stores and distributes artifacts needed for development.
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)
sudo su -
cd /opt
yum install tar wget –y
wget https://download.sonatype.com/nexus/3/nexus-3.40.1-01-unix.tar.gz
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
visudo
nexus ALL=(ALL) NOPASSWD: ALL
#Change the owner and group permissions to /opt/nexus and /opt/sonatype-work directories.
vi /opt/nexus/bin/nexus.rc
run_as_user="nexus"
ln -s /opt/nexus/bin/nexus /etc/init.d/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
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
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