When the primary appliance fails, you can perform a database failover.
When the primary appliance fails, the secondary database is read-only. When failover occurs, perform the following tasks:
Enable write operations on the secondary database
Permanently promote the secondary appliance to become the primary appliance
Restart the primary appliance
Enable Write Operations on the Secondary Database
The goal of this procedure is to switch the master database to the secondary appliance (tenant or service provider) if the primary appliance is not available. The goal is to enable write operations so that the secondary appliance's database is the master datasource.
Stop the dtService, av-manager, and diagnose service on both the primary (if accessible) and the secondary appliance:
sudo service dtService stop sudo service av-manager stop sudo service diagnose stop
Stop all slony daemons on both the primary (if accessible) and the secondary appliances:
sudo killall slon
On the secondary appliance, connect to the fdb database and execute the following SQL command:
drop schema _slony cascade;
Repeat step 3 for the EDB and AVDB if the appliance belongs to a tenant organization.
If the database on the primary appliance is still accessible, then backup the database, copy the database files, and restore the database into the secondary appliance (see Backing Up and Restoring Databases).
Open the file /usr/local/desktone/release/active/conf/fdb.properties for edit and remove the IP address of the primary appliance.
Repeat step 6 for /usr/local/desktone/release/active/edb.properties if the appliance belongs to a tenant organization.
Repeat step 6 for /usr/local/desktone/release/active/avdb.properties if the appliance belongs to a tenant organization.
Set DB_HOST and DB_PASSWORD environment variables:
export DB_HOST=IP_of_TA2_appliance export DB_PASSWORD=database_password
Execute av-setup script as sudo:
Open the applications.properties file for editing:
In the applications.properties file, edit lines as follows:
db.jdbc.url=jdbc:postgresql://<ip address>:5432/avdb?ssl=true db.fdb.jdbc.url=jdbc:postgresql://<ip address>:5432/fdb?ssl=true
Start dtService, av-manager, and diagnose service on the secondary appliance:
service dtService start service av-manager start service diagnose start
Promote the Secondary Appliance to Primary Appliance
To permanently promote the secondary appliance to be the primary appliance, you need to reinitialize slony as described in Reinitialize Slony.
Restart the Primary Appliance
When you restart the primary appliance after failover, perform a slony reinitialization on both the edb and avdb.