The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
To install HAProxy:
Install the
haproxy
package on each front-end server:#
yum install haproxy
Edit
/etc/haproxy/haproxy.cfg
to configure HAProxy on each server. See Section 17.2.1, “About the HAProxy Configuration File”.Enable IP forwarding and binding to non-local IP addresses:
#
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
#echo "net.ipv4.ip_nonlocal_bind = 1" >> /etc/sysctl.conf
#sysctl -p
net.ipv4.ip_forward = 1 net.ipv4.ip_nonlocal_bind = 1Enable access to the services or ports that you want HAProxy to handle.
For example, to enable access to HTTP and make this rule persist across reboots, enter the following commands:
#
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
#service iptables save
Enable and start the
haproxy
service on each server:#
chkconfig haproxy on
#service haproxy start
If you change the HAProxy configuration, reload the
haproxy
service:#
service haproxy reload