Introduction
This article describes how to change the startup order for Systran components dependent to MongoDB.
Description
On overloaded platforms, the mongod service could take some time to boot. Some of Systran components need to connect on MongoDB on boot which requires to have an up & running MongoDB instance before starting these components.
By default, the Systran components don't embed the following startup scripts tweaks but remains easy & fast to implement.
Implementation
On CentOS/RedHat 7
Edit the file /etc/systemd/system/multi-user.target.wants/systran-corpus-manager2.service and add entries (in bold) below:
[Unit] Description=Systran Corpus Manager2 is server to manage corpus Wants=mongod.service rabbitmq-server.service redis.service elasticsearch.service After=network.target mongod.service rabbitmq-server.service redis.service elasticsearch.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-gdict.service and add entries (in bold) below:
[Unit] Description=Systran Gdict is server Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-routing.service and add entries (in bold) below:
[Unit] Description=Stystran Routing is server to rout message Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-dct-indexer.service and add entries (in bold) below:
[Unit] Description=DctIndexer is used to index dictionnaries Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-tm-indexer.service and add entries (in bold) below:
[Unit] Description=Systran Tm-Indexer is server to index tm Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-ses-console.service and add entries (in bold) below:
[Unit] Description=Systran Enterprise Server Console Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-ses-gateway.service and add entries (in bold) below:
[Unit] Description=Systran Entreprise Server Translation Gateway Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Edit the file /etc/systemd/system/multi-user.target.wants/systran-trs-console.service and add entries (in bold) below:
[Unit] Description=Systran Translation Resource Store is node js server web Wants=mongod.service rabbitmq-server.service redis.service After=network.target mongod.service rabbitmq-server.service redis.service
Then reload the services configuration
systemctl daemon-reload
Then restart changed services
systemctl restart systran-corpus-manager2.service systemctl restart systran-dct-indexer.service systemctl restart systran-gdict.service systemctl restart systran-routing.service systemctl restart systran-tm-indexer.service
Automation
The attached ses8-systemd-tweaks.sh is available to perform the above actions automatically.