Installing HAProxy by Using a Script
- Obtain the HAProxy script package.
- Download the script package using the local browser.
URL: https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/haproxy_automation.tar.gz
- Save the script package haproxy_automation.tar.gz to the /home directory.
If the server is connected to the Internet, you can run the wget command on the server to download the script package.
- Download the script package using the local browser.
- Go to the /home directory and decompress the script package.
1cd /home/
1tar -xzvf haproxy_automation.tar.gz

- Switch to the haproxy_automation directory and view the files in the directory.
1cd haproxy_automation
1ll

For details about the script directory structure, see Table 1.
Table 1 haproxy_automation directory structure Folder or File
Description
deps
Directory used for compilation and installation.
NOTE:The installation script first obtains the HAProxy source code using the wget command. If the server is not connected to the Internet, download the HAProxy source code (see Compiling and Installing HAProxy from Source Code) and save the source code to this directory.
scripts
Folder in which common tuning scripts are stored.
install.sh
Script used to compile, deploy, and tune HAProxy.
rollback.sh
Script used to roll back all the operations performed by the script.
- Run the install.sh script. After the script is executed, restart the server for the tuning to take effect.
1sh install.sh
- The script contains only common tuning. Software tuning needs to be performed based on actual situation.
- (Optional) If the environment needs to be rolled back or the deployment using a script fails, run the rollback script to roll back the script operation and restart the device.
1sh rollback.sh