-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhaproxy.sh
More file actions
executable file
·32 lines (24 loc) · 876 Bytes
/
haproxy.sh
File metadata and controls
executable file
·32 lines (24 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
##########################################################################
# Module: haproxy
# Description: Install haproxy Load Balancer
##########################################################################
# TODO: haproxy.cfg
ANSWERS=/root/bashstack/answers.txt
if [[ ! -f $ANSWERS ]] ; then
echo "Answer file ($ANSWERS) does not exist. Exiting."
else
source $ANSWERS
fi
yum -y install haproxy
echo net.ipv4.ip_nonlocal_bind=1 >> /etc/sysctl.d/haproxy.conf
echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind
# the keepalive settings must be set in *ALL* hosts interacting with rabbitmq.
cat >/etc/sysctl.d/tcp_keepalive.conf << EOF
net.ipv4.tcp_keepalive_intvl = 1
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_time = 5
EOF
sysctl net.ipv4.tcp_keepalive_intvl=1
sysctl net.ipv4.tcp_keepalive_probes=5
sysctl net.ipv4.tcp_keepalive_time=5