Run Relational Migrator as a System Service on RHEL/CentOS
On this page
When you install Relational Migrator on a RHEL/CentOS server, you can also set up Relational Migrator to run as a system service. By running Relational Migrator as a system service, Relational Migrator automatically starts when the server starts.
Steps
Create a
/etc/systemd/system/migrator.service
file.Copy the text below into the
/etc/systemd/system/migrator.service
file. Replace the binary path as needed.[Unit] Description=MongoDB Relational Migrator [Service] ExecStart="/opt/mongodb-relational-migrator/bin/MongoDB Relational Migrator" [Install] WantedBy=multi-user.target Reload
systemd
to read the newly created service:systemctl daemon-reload Enable the Relational Migrator service to run on startup and start for the current session.
You can manage the service with
systemctl
commands. To run on startup and start the current session, run the following:systemctl enable migrator.service systemctl start migrator.service