Nexus3の移行プロセスは、新しいサーバーにディレクトリ全体をコピーし、あなたが開始することができ、非常に簡単です。
バックアップ
元のサーバーへのバックアップにnexus3全体のディレクトリ。
$ tar -zcvf nexus3.tar.gz nexus3/
ヒント:私のnexus3全体のディレクトリには直接によって、13Gを持ってtmux
使用してscp
リモートターゲットサーバーをコピーするコマンドを。
移行
# 创建 nexus 用户
$ useradd nexus
$ passwd nexus
$ su - nexus
# scp 备份文件到新服务器
$ scp [email protected]:~/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 的 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