How to move Sonata Stats to a remote server? 

If you’d like to move Sonata Stats to another server, to reduce the load on the main VitalPBX server. 

  1. Install the Sonata Stats on your new server. 
  1. Then, you will need to edit this file /usr/share/sonata/queues-stats/backend/.env 

On this configuration, you will need to enter the IP address of the asterisk, server port, and credentials. 

  1. In the Linux CLI, execute the command below. 
  1. Create a user with all permissions for the sonata_stats database. 

grant all privileges on sonata_stats.*  to “stats”@”localhost” identified by “SECURE_PWD” 

  1. On the .env file edit these configurations and enter the credentials created in the previous step. 
  1. From this location /usr/share/sonata/queues-stats/backend execute these commands 
  1. To create our admin user, we have to execute the command below. 
  1. Then, we have to paste the following code. 
  1. Finally, edit the file /var/lib/sonata/stats/wizard.conf and configure the flag below. 

Now, you should be able to access sonata stats from your new server. 

What are your feelings
Updated on December 4, 2023