How to connect two ASTPP server to the same database
By Yevgeniya Suminova on 2021-06-15
Contents
Connecting ASTPP2 to the DB of ASTPP1
The aim of this task is to be able to separate the Database server from Freeswitch server. This will allow to perform large operations with the DB such as, importing and exporting rates and tariffs without overloading the server that handles all calls.
1. We should already have two ASTPP servers installed by following these instructions: https://docs.switzernet.com/3/public/210311-astpp-instalation/
2. Knowledge how to login via ssh to the server
Open port 3306 on both servers:
sudo su
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
On ASTPP1 change the authorized host for astppuser:
mysql -u root -p
use mysql;
update user host = ‘%’ where user = ‘astppuser’;
Give privileges to the astppuser:
GRANT ALL PRIVILEGES ON *.* TO 'astppuser'@'%' WITH GRANT OPTION;
Then check ability to connect from ASTPP2 to ASTPP1 mysql client by astppuser:
mysql -u astppuser -h ASTPP1ipaddress -p
On ASTPP2 we will now need to modify some files:
nano /var/lib/astpp/astpp-config.conf
Change dbhost and dbpass to the data from ASTPP1
Save the file as follows: Ctrl+x => Y => Hit Enter
Then do the same change as above in another file “/var/lib/astpp/astpp.lua”
nano /var/lib/astpp/astpp.lua
Save the file as follows: Ctrl+x => Y => Hit Enter
Then make changes in the following three files:
nano /etc/odbc.ini
nano /opt/ASTPP/misc/odbc/cent_odbc.ini
nano /opt/ASTPP/misc/odbc/deb_odbc.ini
Where you see password as <PASSWORD> - keep it as it is.
You are done.
Now go to the web GUI of both ASTPPs and do some changes like creating new accounts. You will see that when you’ve created an account on ASTPP1, you will see the same data on ASTPP2 and vice versa. This is because they are both now connected to the DB of ASTPP1.
When ASTPP2 is connected to the DB of ASTPP1, it is not possible to see “Registered SIP Devices” and “Registered Gateways” on ASTPP2. It is also not possible to see customer registered on ASTPP2 from ASTPP1.
To resolve this problem, it is most probably necessary to add a new SIP profile and/or add another Freeswitch server.
To understand how to add new SIP profile (what has to be done on both servers?)
To understand how to add a Freeswitch (what has to be done on both servers?
https://docs.switzernet.com/3/public/210311-astpp-instalation/
***
© 4z.com