Docs 菜单
Docs 主页
/
Relational Migrator
/ /

RHEL/CentOS 系统安装

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

Relational Migrator在 RHEL/ CentOS上使用以下文件位置:

  • 配置文件

    ~/Migrator/user.properties

  • 下载的 JDBC 驱动程序

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

  • 日志文件

    ~/Migrator/Logs/migrator.log

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

  2. 安装 Relational Migrator。

    sudo yum install mongodb-relational-migrator-<version_number>-1.x86_64.rpm
  3. (可选)要连接到 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

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

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

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

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

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

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

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

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

    默认下, Relational Migrator配置为在端口 8278 上运行。要更改Relational Migrator运行的端口,更新user.properties文件中的 server.port 行以指定首选端口。

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

    bin目录的路径是 /opt/mongodb-relational-migrator/bin

    要使用二进制文件运行 Relational Migrator,请运行以下命令:

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

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

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

在 RHEL/ CentOS服务器上安装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

后退

Windows Server

在此页面上