文档菜单
文档首页
/
关系型迁移器
/ / /

在 RHEL/CentOS 上将关系型迁移器作为系统服务运行

本页内容

  • 步骤
  • 下一步操作
  • 了解更多

当您在RHEL/CentOS服务器上安装关系迁移器时,也可以将关系迁移器设置为以系统服务的方式运行。通过以系统服务方式运行关系迁移器,关系迁移器将在服务器启动时自动启动。

  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. 启用关系迁移器服务在启动时运行并在当前会话中启动。

    您可以使用 systemctl 命令管理服务。要启动并开始当前会话,请运行以下命令

    systemctl enable migrator.service
    systemctl start migrator.service
  • 创建项目

  • 导入项目

后退

安装

© . All rights reserved.