DEV Community

Tuna Çöllü for Açıklab

Posted on

2

Oracle Linux 8 NEXUS OSS Kurulumu

1- Java JDK'yı yükleyin

Nexus Java tabanlı bir uygulamadır bu yüzden sanal makinenizde java yüklü olmalıdır, eğer değilse aşağıdaki kod satırını yazarsanız indirebilirsiniz:

dnf install java-1.8.0-openjdk.x86_64 -y

Enter fullscreen mode Exit fullscreen mode

İndirdikten sonra bu kod satırı ile Java versiyonunun doğrulayabilirsiniz:

java -version

Enter fullscreen mode Exit fullscreen mode

Şuna benzeyen bir output almanız gerekmektedir:

openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
Enter fullscreen mode Exit fullscreen mode

2- Sonatype Nexus Oracle Linux 8 Kurulumu

Sanal makinemize javayı kurduktan sonra Nexus kurulumuna başlayabiliriz. Öncelikle bir Nexus kullanıcısı oluşuralım:

adduser nexus

Enter fullscreen mode Exit fullscreen mode

Daha sonra Nexus dosyalarını saklamak için bir dizin oluşturalım:

mkdir /app

Enter fullscreen mode Exit fullscreen mode

Sonrasında uzantının altına gelelim ve Nexus'un güncel versiyonunu indirelim:

cd /app
wget -O nexus.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz
Enter fullscreen mode Exit fullscreen mode

İndirdiğimiz sıkıştırılmış dosyayı açalım ve ismini değiştirelim:

tar -xvf nexus.tar.gz
mv nexus-3* nexus

Enter fullscreen mode Exit fullscreen mode

Gerekli yetkileri ve izinleri verelim:

chown -R nexus:nexus /app/nexus
chown -R nexus:nexus /app/sonatype-work
Enter fullscreen mode Exit fullscreen mode

Nexus config dosyasının içine gidelim ve altaki satırı değiştirerek Nexus kullanıcısını tanımlayalım:

nano /app/nexus/bin/nexus.rc
run_as_user="nexus"
Enter fullscreen mode Exit fullscreen mode

3- Systemd Servisi Oluşturma

Nexusu kullanabilmek için bir systemd servis dosyası oluşturmak gerekiyor, altaki komut ile dosyayı oluşturup içini dolduruyoruz:

nano /etc/systemd/system/nexus.service

Enter fullscreen mode Exit fullscreen mode
[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/app/nexus/bin/nexus start
ExecStop=/app/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target

Enter fullscreen mode Exit fullscreen mode

Dosyayı kaydedip sistemi tekrar yükleyip ayağa kaldırıyoruz:

systemctl daemon-reload
systemctl start nexus
systemctl enable nexus

Enter fullscreen mode Exit fullscreen mode

Şu şekilde bir output almanız gerekiyor:

● nexus.service - nexus service
   Loaded: loaded (/etc/systemd/system/nexus.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-09-01 07:51:39 EDT; 5s ago
  Process: 13727 ExecStart=/app/nexus/bin/nexus start (code=exited, status=0/SUCCESS)
 Main PID: 13939 (java)
    Tasks: 47 (limit: 49496)
   Memory: 509.2M
   CGroup: /system.slice/nexus.service
           └─13939 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64/jre/bin/java -server -Dinstall4j.jvmDir=/usr/lib/jvm/java-1.8>

Sep 01 07:51:39 oraclelinux8 systemd[1]: Starting nexus service...
Sep 01 07:51:39 oraclelinux8 systemd[1]: Started nexus service.
Enter fullscreen mode Exit fullscreen mode

4- Nexus Web Arayüzüne Erişim

Bu noktada Nexus 8081 portu üzerinden çalışmaya başlayacak, bu komut ile kontrol edebilirsiniz:

ss -antpl

Enter fullscreen mode Exit fullscreen mode

Şu şekilde bir output almanız gerekmekte:

State        Recv-Q       Send-Q             Local Address:Port              Peer Address:Port       Process                                  
LISTEN       0            1                      127.0.0.1:42221                  0.0.0.0:*           users:(("java",pid=13939,fd=118))       
LISTEN       0            50                       0.0.0.0:8081                   0.0.0.0:*           users:(("java",pid=13939,fd=971)) 
Enter fullscreen mode Exit fullscreen mode

Nexus'un varsayılan kullanıcı adı admin ve şifresi /app/sonatype-work/nexus3/admin.password içinde yazan satırdır. cat /app/sonatype-work/nexus3/admin.password komutu ile şifreyi kopyalayıp http://your-server-ip:8081
arayüzünde kullanıcı adı şifre kombinasyonu yaparak Nexus'a erişim sağlayabilirsiniz.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay