Docs 菜单
Docs 主页
/
Relational Migrator
/ /

Debian 系统安装

您可以在Debian服务器上安装Relational Migrator 。这种安装方法允许Relational Migrator在无人值守的服务器上运行。在无人值守的服务器上运行时, Relational Migrator会绑定到服务器上的任何IP和端口,并将其公开为 Web应用程序。

Relational Migrator在Debian Linux上使用以下文件位置:

  • 配置文件

    ~/Migrator/user.properties

  • 下载的 JDBC 驱动程序

    /opt/mongodb-relational-migrator/lib/app/lib

  • 日志文件

    ~/Migrator/Logs/migrator.log

  1. 发布页面下载最新的 .deb 二进制文件。

  2. 更新系统包管理器存储库:

    sudo apt update
  3. (对于无头Linux发行版)创建所需的目录:

    sudo mkdir /usr/share/desktop-directories/
  4. 安装 Relational Migrator。

    sudo apt install ./mongodb-relational-migrator_<version_number>-1_amd64.deb
  5. (可选)要连接到 Oracle 或 MySQL 驱动程序,请下载驱动程序并将其放入 Relational Migrator 目录中。

    1. 要下载并安装 MySQL 或 Oracle 驱动程序,请参阅以下内容:

    2. 将驱动程序文件复制到/opt/mongodb-relational-migrator/lib/app/lib

      要复制驱动程序,请使用以下示例:

      curl https://download.oracle.com/otn-pub/otn_software/jdbc/216/ojdbc11.jar -O -L -b -o

    有关更多信息,请参阅在本地计算机上安装。

  6. 将目录更改为 Relational Migrator /bin位置并启动应用程序。

    cd /opt/mongodb-relational-migrator/bin
    ./mongodb-relational-migrator
  7. 允许 Relational Migrator 作为无人值守的独立运行的实例运行。

    user.properties文件中,取消注释spring.profiles.active: unattended

  8. (可选)更新 TLS/SSL 配置属性。

    user.properties文件中,取消注释并更新 TLS/SSL 配置属性。

    建议在无人值守的服务器上为Relational Migrator配置 TLS/SSL。您可以将Relational Migrator绑定到服务器上的任何IP和端口。有关其他信息,请参阅 TLS/SSL 配置属性。

  9. (可选)更新 Relational Migrator 运行的端口。

    默认下, Relational Migrator配置为在端口 8278 上运行。要更改Relational Migrator运行的端口,更新user.properties文件中的 server.port 行以指定首选端口。示例,您可能希望对HTTP使用端口 80,或对 HTTPS 使用端口 443

  10. 使用二进制文件运行 Relational Migrator。

    bin目录路径是 /opt/mongodb-relational-migrator/bin。要使用二进制文件运行Relational Migrator ,运行以下命令:

    cd /opt/mongodb-relational-migrator/bin
    ./mongodb-relational-migrator
  11. (可选)检查日志中是否有错误或其他信息。

    • 日志位于~/Migrator/Logs/migrator.log中。

    • 将 Relational Migrator 作为系统服务运行时,该路径位于服务用户的主目录下。

在Debian服务器上安装Relational Migrator时,还可以将Relational Migrator设立为系统服务运行。将Relational Migrator作为系统服务运行时, Relational Migrator会在服务器启动时自动启动。

  1. 创建/etc/systemd/system/migrator.service文件。

    将以下文本复制到/etc/systemd/system/migrator.service文件中。 根据需要替换二进制路径。

    [Unit]
    Description=MongoDB Relational Migrator
    [Service]
    ExecStart="/opt/mongodb-relational-migrator/bin/MongoDB Relational Migrator"
    [Install]
    WantedBy=multi-user.target
  2. 重新加载 systemd 以读取新创建的服务。

    systemctl daemon-reload
  3. 启用 Relational Migrator 服务以在服务器启动时自动启动。

    您可以使用以下systemctl命令托管该服务:

    systemctl enable migrator.service
    systemctl start migrator.service

如果安装因错误而失败,请使用以下命令查看错误详细信息:

sudo dpkg -i ./mongodb-relational-migrator_<version_number>-1_amd64.deb

后退

RHEL/CentOS Linux

在此页面上