开发工具分享
  • 首页
  • 计算科学
  • 文化旅游
  • 项目和网站
    • OSSEZ 计算技术
    • USRealEstate 社区
    • 地区文化
    • CWIKI.US
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
CWIKIUS.CN
一个有独立思考和温度的清新站
  1. Home
  2. Computer Science
  3. This article

Sonatype Nexus 服务器迁移

2024年04月13日 659Browse 0Like 0Comments

因为服务器的升级和调整,有时候会对安装 Sonatype Nexus 的服务器进行迁移到新服务器上。

从技术架构上来说,Sonatype Nexus 我们使用的是 AWS 的存储,所以我们并不需要拷贝大量的数据。

文件夹结构

在备份和恢复之前,我们需要知道我们要拷贝那些文件夹。

Nexus 真正程序运行使用的文件是 2 个,我们把这 2 个文件夹部署在了 /opt 目录下。

如下图:

在备份迁移的时候,我们需要把这 2 个文件夹给备份到新服务器上。

可以使用 tar 压缩后转移的方式。

当我们从老服务器上把数据下载下来后,可以直接把老服务器上的这 2 个文件夹拷贝到新的服务器上。

新服务器上设置用户权限

在新服务器上依次运行命令:

useradd --system --no-create-home nexus

chown -R nexus:nexus /opt/nexus

chown -R nexus:nexus /opt/nexusdata

因为我们是拷贝服务器的配置来进行安装的,所以其他的配置都不需要修改,但是针对 Linux 操作系统平台的一些配置还是需要修改的。

修改用户打开文件限制

这个是 Linux 的限制,我们需要进行修改。

打开文件:

vi /etc/security/limits.conf

在文件的最后添加下面的内容。

nexus - nofile 65536

然后保存退出。

设置 Nexus 为服务

使用命令编辑下面的文件:

vi /etc/systemd/system/nexus.service

将下面的内容复制到这个文件中。

[Unit]
Description=Nexus Service
After=syslog.target network.target

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

[Install]
WantedBy=multi-user.target

将服务设置开机启动,并且启动 nexus 服务。

依次运行下面的命名:

systemctl daemon-reload

systemctl enable nexus.service

启动服务

输入下面的命令来启动服务。

systemctl start nexus

查看服务启动状态

运行下面的命令来查看服务启动的状态。

tail -f /opt/nexusdata/nexus3/log/nexus.log
https://www.isharkfly.com/t/sonatype-nexus/15628
Tags: None
Last updated:2024年04月13日

HoneyMoose

有温度的人文和独立的思考

Like
< Previous
Next >

Comments

Cancel reply

Archives
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
Categories
  • Computer Science (2,362)
    • Confluence (663)
    • Gradle (12)
  • U.S. (482)
  • 文化旅游 (145)

COPYRIGHT © 2020 CWIKIUS. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS

湘ICP备2020018253号-1