Ec2 Configure: Error: Cannot Find M4 Utility. Install M4 and Try Again.
Sonatype Nexus is one of the best open-source artifact management tools. It is some tool that you cannot avoid in your CI/CD pipeline. It effectively manages deployable artifacts.
Sonatype Nexus Arrangement Requirements
- Minimum 1 VCPU & 2 GB Retentivity
- Server firewall opened for port 22 & 8081
- OpenJDK eight
- All Nexus processes should run as a non-root nexus user.
Notation: For product setup, please consider minimum product hardware requirements based on the nexus usage and data storage. Bank check out the official arrangement requirements document for detailed information
Sonatype Nexus 3 on Linux ec2
This article guides yous to install and configure Sonatype Nexus 3 in a secure way on an ec2 Linux System.
Annotation: This was tested on a Redhat automobile and information technology will work on Centos or related Linux flavors as well.
Step 1: Login to your Linux server and update the yum packages. Also install required utilities.
sudo yum update -y sudo yum install wget -y
Footstep 2: Install OpenJDK one.viii
sudo yum install java-1.8.0-openjdk.x86_64 -y
Pace 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.
sudo wget -O nexus.tar.gz https://download.sonatype.com/nexus/three/latest-unix.tar.gz
Untar the downloaded file.
sudo tar -xvf nexus.tar.gz
Rename the untared file to nexus.
sudo mv nexus-three* nexus
Step 5: As a adept security practice, it is not advised to run nexus service with root privileges. So create a new user named nexus
to run the nexus service.
sudo adduser nexus
Change the ownership of nexus files and nexus data directory to nexus user.
sudo chown -R nexus:nexus /app/nexus sudo chown -R nexus:nexus /app/sonatype-piece of work
Step 6: Open up /app/nexus/bin/nexus.rc
file
sudo vi /app/nexus/bin/nexus.rc
Uncomment run_as_user parameter and set information technology every bit following.
run_as_user="nexus"
Footstep vii: If you desire to change the default nexus information directory, open up the nexus properties file and change the data directory -Dkaraf.data
parameter to a preferred location as shown below. If you lot don't specify anything, by default nexus data directory will be set up to /app/sonatype-piece of work/nexus3
Tip: For production setup, it is is always better to mountain the nexus data directory to a split data deejay attached to the server. So that backup and restore tin can be done easily.
sudo half dozen /app/nexus/bin/nexus.vmoptions
An example configuration is shown below.
-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Xx:+UnlockDiagnosticVMOptions -Xx:+UnsyncloadClass -Xx:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -Xx:-OmitStackTraceInFastThrow -Djava.net.preferIPv4Stack=truthful -Dkaraf.abode=. -Dkaraf.base of operations=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/coffee.util.logging.properties -Dkaraf.data=/nexus/nexus-data -Djava.io.tmpdir=../sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=simulated
Running Nexus every bit a System Service
It is better to have systemd
entry to manage nexus using systemctl
. Follow the steps given below for adding nexus as a systemd
service.
Create a nexus systemd unit file.
sudo vi /etc/systemd/organization/nexus.service
Add the post-obit contents to the unit of measurement file.
[Unit] Description=nexus service After=network.target [Service] Type=forking LimitNOFILE=65536 User=nexus Grouping=nexus ExecStart=/app/nexus/bin/nexus start ExecStop=/app/nexus/bin/nexus finish User=nexus Restart=on-abort [Install] WantedBy=multi-user.target
Manage Nexus Service
At present we have all the configurations in place to run nexus.
Execute the following command to add nexus service to boot.
sudo chkconfig nexus on
To get-go the Nexus service, use the post-obit command. If you are having trouble starting nexus, please check the troubleshooting section below.
sudo systemctl start nexus
The above command will start the nexus service on port 8081
. To admission the nexus dashboard, visit http://:8081. You will be able to see the nexus homepage as shown beneath.
To log in, use the default username and password.
Default username is admin
You lot can find the default admin password in /app/sonatype-work/nexus3/admin.password
file. The path will exist shown in the login screen every bit prove beneath.
cat /app/sonatype-work/nexus3/admin.password
Once you lot login, you volition be prompted to reset the password.
For stopping nexus, execute
sudo systemctl stop nexus
For restarting nexus,
sudo systemctl restart nexus
Sonatype Nexus non Starting [Troubleshooting]
Sometimes, if the server is enabled with SELINUX, you lot might get the following error. (Usually on Centos Servers)
Chore for nexus.service failed considering the control process exited with mistake code. Come across "systemctl status nexus.service" and "journalctl -xe" for details.
Execute the following command and see the actual error.
journalctl -xe
Check the output for the following SELINUX issue.
SELinux is preventing /usr/lib/systemd/systemd from execute access on the file nexus.
To rectify this outcome, add together a SELinux policy to allow Systemd to admission the nexus binary in path /app/nexus/bin/nexus
using the following control.
sudo chcon -R -t bin_t /app/nexus/bin/nexus
Now, first the Nexus server again.
sudo systemctl start nexus
You Might Like
How to cheque the Nexus version in Linux?
Yous can find the Nexus version from the Dashboard. Besides, if you desire to detect the version from the Linux command line, execute the following control.
curl --include --silent http://localhost:8081/ | grep Server
How to start Nexus in Linux?
Nexus binary comes equally an executable. You tin utilize the binary path to kickoff nexus. For background execution, you tin create a systemd file with nexus configurations.
Source: https://devopscube.com/how-to-install-latest-sonatype-nexus-3-on-linux/
0 Response to "Ec2 Configure: Error: Cannot Find M4 Utility. Install M4 and Try Again."
Postar um comentário