This article describes the way to start the program complex via the process manager PM2.
Setting up PM2
On the host with the program complex install PM2 using the command:
For all of actors set in-memory mode in the file. For instance:
If the program complex has been started as a service, it is necessary to stop and disable the service.
Command to stop the service:
Systemctl command to disable the service:
Init command to disable the service:
Start program complex via PM2
In order to start the program complex via PM2 execute the command:
In order to set automatic start of the services when the OS is booted, execute the command:
Setting up logs
Logs for each actor is recorded to the folder.
In order to set up log rotation, create the settings fileand add to it the following content:
Work with actors
In order to check statuses of the actors execute the command:
Monitoring of work of the actors in real-time mode:
In order to stop/start/restart one actor or all of the actors the following commands are used:
In order to scale the actors execute the command:
- saymon-rest-server is the name of the actor,
- 4 is the necessary amount of actors.
Restarting the program complex is not obligatory.