https://www.haproxy.org
https://github.com/haproxy/haproxy/releases
yum install make gcc gcc-c++ openssl openssl-devel -y
wget https://www.haproxy.org/download/2.4/src/haproxy-2.4.3.tar.gz
tar haproxy-2.4.3.tar.gz
make TARGET=linux-glic PREFIX=/srv/app/haproxy
146 PREFIX = /srv/app/haproxy
157 TARGET = 指定内核类型
make install PREFIX=/srv/app/haproxy
cat /usr/lib/systemd/system/haproxy.service
[Unit]
Description=HAProxy Load Balancer
After=network.target
[Service]
EnvironmentFile=-/etc/default/haproxy
EnvironmentFile=-/etc/sysconfig/haproxy
Environment="CONFIG=/data/haproxy/etc/haproxy.cfg" "PIDFILE=/run/haproxy.pid" "EXTRAOPTS=-S /run/haproxy-master.sock"
ExecStartPre=/data/haproxy/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecStart=/data/haproxy/sbin/haproxy -W -f $CONFIG -p $PIDFILE $EXTRAOPTS
ExecReload=/data/haproxy/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
SuccessExitStatus=143
Type=forking
[Install]
WantedBy=multi-user.target