logo

Settings

HAProxy-WI config


Edit $HOME_HAPROXY-WI/app/haproxy-wi.cfg with your env. Default config:
[main]
#Path to files destination
fullpath = /var/www/haproxy-wi
log_path = ${fullpath}/log/

[configs]
#Dir where configs will be save
haproxy_save_configs_dir = ${main:fullpath}/configs/hap_config/
kp_save_configs_dir = ${main:fullpath}/configs/kp_config/

[mysql]
#Enable MySQL DB. Default will be used Sqlite DB. Default disable
enable = 0
mysql_user = haproxy-wi
mysql_password = haproxywi
mysql_db = haproxywi
mysql_host = 127.0.0.1
mysql_port = 3306

		

HAProxy config


For Runtime API, Metrics and Alerting enable state file and stat socket on the HAProxy servers and needs install socat to the all haproxy servers, and configre the HAProxy:
global
    stats socket *:1999 level admin 
    stats socket /var/run/haproxy.sock mode 600 level admin
    server-state-file /etc/haproxy/haproxy.state

defaults
    load-server-state-from-file global

listen stats 
    bind *:8085
    stats enable
    stats uri /stats
    stats realm HAProxy-04\ Statistics
    stats auth admin:password
    stats admin if TRUE 
		

DB settings


Default the HAProxy-WI uses the Sqlite, if you want to use the MySQL enable it in config:

  • [mysql]
  • #Enable MySQL DB. Default will be used Sqlite DB. Default disable
  • enable = 1
  • mysql_user = haproxywi
  • mysql_password = haproxy-wi
  • mysql_db = haproxywi
  • mysql_host = 127.0.0.1


And create a database:

  • MariaDB [(none)]> create user 'haproxy-wi'@'%';
  • MariaDB [(none)]> create database haproxywi;
  • MariaDB [(none)]> grant all on haproxywi.* to 'haproxy-wi'@'%' IDENTIFIED BY 'haproxy-wi';
  • MariaDB [(none)]> grant all on haproxywi.* to 'haproxy-wi'@'localhost' IDENTIFIED BY 'haproxy-wi';