Linux 下遷移 Nexus3


Nexus3 的遷移過程還是非常簡單,復制整個目錄到新服務器,啟動即可。

備份

在原來服務器上將 nexus3 整體目錄備份即可。

$ tar -zcvf nexus3.tar.gz nexus3/

tips:我的 nexus3 整體目錄有 13G,直接通過 tmux 使用 scp 命令遠程復制到目標服務器的。

遷移

# 創建 nexus 用戶
$ useradd nexus
$ passwd nexus
$ su - nexus

# scp 備份文件到新服務器
$ scp nexus@x.x.x.x:~/nexus3.tar.gz .

# 解壓
$ tar -zxvf nexus3.tar.gz

# 啟動
$ ./nexus3/nexus-3.12.1-01/bin/nexus start

# 驗證
$ curl http://localhost:8081/nexus

配置文件

# 查看配置文件,根據需要修改
$ vi /home/nexus/nexus3/nexus-3.12.1-01/etc/nexus-default.properties
## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path=/nexus

# Nexus section
nexus-edition=nexus-pro-edition
nexus-features=\
 nexus-pro-feature

問題

問題一:Nexus max file descriptors

解決方法

# 配置 nexus 的 nofile 為65536
$ echo "nexus - nofile 65536" >> /etc/security/limits.conf

# 重啟 nexus 生效
$ ./nexus3/nexus-3.12.1-01/bin/nexus restart
# 啟動 nexus,報錯警告
$ ./nexus start
WARNING: ************************************************************
WARNING: Detected execution as "root" user.  This is NOT recommended!
WARNING: ************************************************************
Starting nexus

解決方法

# 在 bin 目錄下創建 nexus.rc
$ echo "run_as_user=nexus" > /home/nexus/nexus3/nexus-3.12.1-01/bin/nexus.rc


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM