Difference between revisions of "VALT Warm Standby"
IVSWikiBlue (talk | contribs) |
IVSWikiBlue (talk | contribs) |
||
Line 1: | Line 1: | ||
{{Aside | hue = 0 | icon = ⚠ | content = <b>DISCLAIMER:</b> This is not a step by step instruction. This article assumes the reader has a working understanding of the VALT application and how to modify the configuration files. This procedure should only be completed by an IVS support engineer. This may be incorporated into the command line menu in the future.}} | {{Aside | hue = 0 | icon = ⚠ | content = <b>DISCLAIMER:</b> This is not a step by step instruction. This article assumes the reader has a working understanding of the VALT application and how to modify the configuration files. This procedure should only be completed by an IVS support engineer. This may be incorporated into the command line menu in the future.}} | ||
__TOC__ | __TOC__ | ||
+ | {{Section | content = | ||
=About= | =About= | ||
− | |||
The easiest way to achieve a highly available VALT server is by utilizing a VM on a Hypervisor with shared storage that supports High Availability (HA). Both VMWare and Hyper-V have integrated HA capabilities. If there is a need to make the VALT server highly available, IVS strongly recommends deploying the VALT appliance in a virtual environment and leveraging the hypervisor's HA capabilities. If this is not an option, the procedure below will allow you to configure two VALT appliances with one as a primary server and the second as a warm standby. This procedure will configure the MYSQL databases in a master slave configuration and replicate all changes from the primary to the standby server. Video files can be synchronized periodically. The configuration given below will replicate video files on a daily basis, but this can be customized by adjusting the cronjob scheduling. | The easiest way to achieve a highly available VALT server is by utilizing a VM on a Hypervisor with shared storage that supports High Availability (HA). Both VMWare and Hyper-V have integrated HA capabilities. If there is a need to make the VALT server highly available, IVS strongly recommends deploying the VALT appliance in a virtual environment and leveraging the hypervisor's HA capabilities. If this is not an option, the procedure below will allow you to configure two VALT appliances with one as a primary server and the second as a warm standby. This procedure will configure the MYSQL databases in a master slave configuration and replicate all changes from the primary to the standby server. Video files can be synchronized periodically. The configuration given below will replicate video files on a daily basis, but this can be customized by adjusting the cronjob scheduling. | ||
− | < | + | |
+ | <hr> | ||
=Prerequisites= | =Prerequisites= | ||
− | |||
*A DNS entry (CNAME or A) resolving to the primary server. | *A DNS entry (CNAME or A) resolving to the primary server. | ||
** This should not be the primary DNS entry for that server and will be changed in the event of a failure. | ** This should not be the primary DNS entry for that server and will be changed in the event of a failure. | ||
Line 18: | Line 18: | ||
* The only config file in /etc/apache2/sites-enabled/ should be valt.conf. If default-ssl.conf is in this directory, delete it. | * The only config file in /etc/apache2/sites-enabled/ should be valt.conf. If default-ssl.conf is in this directory, delete it. | ||
* If using https, the certificate should already be installed on the primary server | * If using https, the certificate should already be installed on the primary server | ||
− | < | + | |
+ | <hr> | ||
=Script Package= | =Script Package= | ||
− | |||
# Download VALTRedundancy.tar.gz by running the following command: <div class="codeText">wget --content-disposition https://ivs.box.com/shared/static/1062styfwr387efew51vt6mzqzsdd1m3.gz -O VALTRedundancy.tar.gz</div> | # Download VALTRedundancy.tar.gz by running the following command: <div class="codeText">wget --content-disposition https://ivs.box.com/shared/static/1062styfwr387efew51vt6mzqzsdd1m3.gz -O VALTRedundancy.tar.gz</div> | ||
# Extract the file using the following command: <code>tar -xvf VALTRedundancy.tar.gz</code> | # Extract the file using the following command: <code>tar -xvf VALTRedundancy.tar.gz</code> | ||
− | < | + | |
+ | <hr> | ||
=Primary Server Config= | =Primary Server Config= | ||
− | |||
Run <code>PrimaryServerConfig.sh</code> on the primary server. Make sure to modify the variables at the top of the script to reflect your environment. Specifically the standbyip must be changed to the ip address of the standby server. | Run <code>PrimaryServerConfig.sh</code> on the primary server. Make sure to modify the variables at the top of the script to reflect your environment. Specifically the standbyip must be changed to the ip address of the standby server. | ||
The script will complete by providing the log file name and position. Make a note of these values as they will be needed to configure the standby server. | The script will complete by providing the log file name and position. Make a note of these values as they will be needed to configure the standby server. | ||
− | < | + | |
+ | <hr> | ||
=Standby Server Config= | =Standby Server Config= | ||
− | |||
#Run <code>sudo -i</code> | #Run <code>sudo -i</code> | ||
#:If you do not use this specific command portions of the script will not execute properly. | #:If you do not use this specific command portions of the script will not execute properly. | ||
Line 40: | Line 40: | ||
If using the VALTRedundancy.tar.gz package, the failure.sh and restore.sh scripts should automatically be copied to the /usr/local/valt/bin/ directory and set to executable. These scripts are provided below if the VALTRedundancy.tar.gz package was not used. It is a good idea to update the variables in these scripts now so they are ready to be used in the event of a failover. | If using the VALTRedundancy.tar.gz package, the failure.sh and restore.sh scripts should automatically be copied to the /usr/local/valt/bin/ directory and set to executable. These scripts are provided below if the VALTRedundancy.tar.gz package was not used. It is a good idea to update the variables in these scripts now so they are ready to be used in the event of a failover. | ||
− | < | + | |
+ | <hr> | ||
=How to Initiate a Failover to the Standby Server= | =How to Initiate a Failover to the Standby Server= | ||
− | |||
# Update the shared DNS entry to reference the standby server. | # Update the shared DNS entry to reference the standby server. | ||
# Run the script by typing the following command: | # Run the script by typing the following command: | ||
#: <code>sudo /usr/local/valt/bin/failure.sh</code> | #: <code>sudo /usr/local/valt/bin/failure.sh</code> | ||
− | < | + | |
+ | <hr> | ||
=How to Return to the Primary Server= | =How to Return to the Primary Server= | ||
− | |||
# Update the shared DNS entry to reference the standby server. | # Update the shared DNS entry to reference the standby server. | ||
# Update the variables in the script below to reflect the correct primary ip, slaveuser, and slavepassword. (If this was not done during initial setup) | # Update the variables in the script below to reflect the correct primary ip, slaveuser, and slavepassword. (If this was not done during initial setup) | ||
# Run the script by typing the following command: | # Run the script by typing the following command: | ||
#: <code>sudo /usr/local/valt/bin/restore.sh</code> | #: <code>sudo /usr/local/valt/bin/restore.sh</code> | ||
− | + | }} | |
− | =Scripts= | + | {{Section | title = <h1>Scripts</h1> | content = |
− | + | {{Section - Expand | title = ValtPrimaryServerConfig.sh | content = | |
− | + | <pre> | |
+ | #!/bin/bash | ||
# This script will configure an existing VALT server to function as a primary server. | # This script will configure an existing VALT server to function as a primary server. | ||
# You will need to run VALTStandbyServerConfig.sh on the warm standby server. | # You will need to run VALTStandbyServerConfig.sh on the warm standby server. | ||
Line 114: | Line 115: | ||
echo -e "Master Log File: $sqlfile" | echo -e "Master Log File: $sqlfile" | ||
echo -e "Master Log Position: $position" | echo -e "Master Log Position: $position" | ||
− | fi</ | + | fi |
+ | </pre> | ||
+ | }} | ||
− | + | {{Section - Expand | title = ValtStandbyServerConfig.sh | content = | |
− | + | <pre> | |
#!/bin/bash | #!/bin/bash | ||
# This script will configure an existing VALT server to function as a | # This script will configure an existing VALT server to function as a | ||
Line 200: | Line 203: | ||
chmod +x /usr/local/valt/bin/restore.sh | chmod +x /usr/local/valt/bin/restore.sh | ||
fi | fi | ||
+ | </pre> | ||
+ | }} | ||
− | + | {{Section - Expand | title = failure.sh | content = | |
− | + | <pre> | |
− | |||
− | |||
#!/bin/bash | #!/bin/bash | ||
#This script will make the redundant VALT server the primary VALT server. | #This script will make the redundant VALT server the primary VALT server. | ||
Line 229: | Line 232: | ||
service valtcontrols start | service valtcontrols start | ||
fi | fi | ||
+ | </pre> | ||
+ | }} | ||
− | + | {{Section - Expand | title = restore.sh | content = | |
− | + | <pre> | |
− | |||
#!/bin/bash | #!/bin/bash | ||
# This script will migrate the database and all recordings back to the primary VALT server. | # This script will migrate the database and all recordings back to the primary VALT server. | ||
Line 276: | Line 280: | ||
mysql --defaults-extra-file=/usr/local/valt/conf/standby.cnf -e "START SLAVE;" | mysql --defaults-extra-file=/usr/local/valt/conf/standby.cnf -e "START SLAVE;" | ||
fi | fi | ||
− | + | </pre> | |
− | </ | + | }} }} |
Revision as of 15:46, 27 July 2023
⚠DISCLAIMER: This is not a step by step instruction. This article assumes the reader has a working understanding of the VALT application and how to modify the configuration files. This procedure should only be completed by an IVS support engineer. This may be incorporated into the command line menu in the future.