Introduction
This article describes how to install and configure a TRM (Translation Resource Monitor) on an remote computing node, for an existing SPNS9 installation.
Description
To improve performance sometimes we may consider to add a different computing node (or backend) and move the SYSTRAN Translation Resource Monitor (TRM). This procedure explains how to install a TRM on a dedicated computing node and configure it to communicate to TRS Console, RabbitMQ server & SES Console.
Procedure
1) Prerequesites
1.1) Update firewall rules on SES Frontend
This will to allow incoming connections from backend
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="[BACKEND_IP]/32" port port="5672" protocol="tcp" accept' # Rabbitmq
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="[BACKEND_IP]/32" port port="3445" protocol="tcp" accept' # TRSL - HTTP
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="[BACKEND_IP]/32" port port="8892" protocol="tcp" accept' # Gdict - HTTP
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="[BACKEND_IP]/32" port port="8889" protocol="tcp" accept' # Corpus manager - HTTP
firewall-cmd --reload
Note 1: RabbitMQ SSL port is 5671 (instead of 5672)
Note 2: updating firewall rules on a Frontend where Docker and TRM already sit may break internal network rules (iptables). If server is not translating, best is to stop TRM then stop Docker and restart first Docker then TRM.
1.2) Open TRM port on new Backend
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="[FRONTEND_IP]/32" port port="8888" protocol="tcp" accept' # TRM - HTTP
firewall-cmd --reload
1.3) Create ulimits conf file on new Backend
Create the /etc/security/limits.d/systran_ses_limits.conf file containing the information below
* hard nofile 65536
* soft nofile 16384
* - nproc unlimited
root - nproc unlimited
systran - nproc unlimited
2) Installation
2.1) Add Repository on the new Backend
Create the /etc/yum.repos.d/systranrpm.repo file by adding the following content. Depending on your version, replace the 'x' for example SPNS 9.x, can be replaced with 9.7 for example
Change the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx string by your TRS key.
[systran-ses]
name=Systran RPM Repository
baseurl=https://repo.systran.net/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/systran_rpm/ses/9.X/centOS7/$basearch
enabled=1
gpgcheck=1
gpgkey=https://repo.systran.net/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/systran_rpm/GPG-KEY-systranreporpm
Add Docker repo and Redis repo:
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
2.2) Install Docker, Redis and SYSTRAN on the new Backend
Run the commands below on the new backend:
yum install -y device-mapper-persistent-data lvm2
yum install -y docker-ce
yum --enablerepo=remi install -y redis
2.3) Install Systran Translation Resources Monitor
yum install -y systran-translation-resource-monitor
3) Configuration on the new Backend
3.1) Docker configuration on then new Backend
Add the docker group and add the systran user to the docker group and start docker
usermod -aG docker systran
3.2) Redis configuration on then new Backend (mandatory for version >=9.3)
Edit the /etc/redis.conf and replace the lines:
# maxmemory <bytes>
by:
maxmemory 1gb
and
# maxmemory-policy noeviction
by
maxmemory-policy allkeys-lru
3.3) SYSTRAN configuration on then new Backend
Edit the file /opt/systran/translation-resource-monitor/etc/trm.cfg and replace the following line:
broker = amqp://systran:SESpassword@localhost:5672
by
broker = amqp://systran:SESpassword@[FRONTEND_IP]:5672
Then edit the file /opt/systran/translation-resource-monitor/etc/source.http.cfg and replace the following line:
trsurl=https://localhost:3445
by
trsurl=https://[FRONTEND_IP]:3445
3.4) Enable and start services on the new Backend:
Docker:
systemctl enable docker
systemctl start docker
Redis (mandatory for version >=9.3):
systemctl enable redis
systemctl restart redis
Start SYSTRAN TRM:
systemctl enable systran-translation-resource-monitor
systemctl restart systran-translation-resource-monitor
4) Computing node registration
Last step consists of registering this computing node (Backend) in your SYSTRAN Server.
- If you are on SPN9; in the SES console go to Menu > Advanced Configuration > Services then click on + Register new service button as described into below screenshot:
Then select the Computing Node option into select box then type the IP or the Hostname of the new Backend (computing node) server then click on Submit as shown below:
5) Check and tests
After registering the new computing node, by clicking on Refresh button, you should see the new computing node listed with status running (green).
This can be checked too into Administration > Service Monitoring then check the new computing node is listed with green state.
The test consists of import & install a new Translation Resource on this new computing node, instantiate it then check if translation runs fine.