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 $/>
解决方法
# 配置 nexus 的 nofile 为65536
$ echo "nexus - nofile 65536" >> /etc/security/limits.conf
# 重启 nexus 生效
$ ./nexus3/nexus-3.12.1-01/bin/nexus restart
问题二:Detected execution as “root” user. This is NOT recommended!
# 启动 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
相关推荐
-
php 实现 jwt2025-04-25 02:03:59
-
PHP导出PDF文件2025-04-25 01:46:22
-
PHP和HTML怎么结合生成PNG图片2025-04-25 01:25:05
-
nginx+njs 配置 模拟2025-04-25 01:01:51
-
nginx websocket 400 – 解决 nginx 反代 wss 出现的 400 错误
nginx websocket 400 – 解决 nginx 反代 wss 出现的 400 错误2025-04-25 00:05:03