If Linux Virtual Server (LVS) based Load Balancer does not satisfy needs Provider may implement own customization scripts for the Load Balancer using the lvsctl script package located on the POA Management Node in the /usr/local/pem/etc/web_cluster/ folder. The Load Balancer configuration scripts are called in the following cases:
- New NG cluster registration
- New shared or exclusive IP address provisioning
- New web server registration
The package consists of 5 Python modules:
- lvs/control.py - command line parsing and driver for lb.py and propagation.py modules.
lvs/__init__.py - Python utility module
- lvs/lb.py - contains configuration structures and allows retrieving current configuration from POA
- lvs/propagation.py - updates LVS configuration using configuration structures created by lb.py module
- lvs/system_al.py - common functions
- lvsctl.py - the main lvsctl module. It will be run by default.
- deploy_ips() - the method updates IPs on public interface of Load Balancer
- deploy_lvs() - the method updates Load Balancer configuration
- print_config() - the auxiliary method which prints Load Balancer configuration instead of updating it
Write you own main lvsctl script (name it as e.g. custom_lvsctl.py) using lvsctl.py and replace LoadBalancerUpdater import with proper one for you installation. Use LoadBalancerUpdater from propagation.py as an example.
When adding a Load Balancer in to the Linux Shared Hosting NG cluster, enable the Custom Configuration Scripts checkbox to specify the new main customization lvsctl scripts as shown on the screenshot:
If you used the above instructions to create a custom lvsctl.py script, the path to the scripts should be specified both in the Update Web Server List and Update Website IP List fields. The script will be called on each update of web server list and website IP list with ‘update’ command and database credentials as arguments. The ‘update’ command will call LoadBalancerUpdater’s deploy_ips() and deploy_lvs() methods sequentially.
See the main Knowledgebase article #114326 Linux Shared Hosting NG: General Information, Best Practices and Troubleshooting for more information about NG Hosting in Parallels Automation.