Haproxy installation CENTOS 7

haproxy installation and configuration centos 7

yum install -y haproxy


##Ignore VIP
echo "net.ipv4.ip_nonlocal_bind = 1" >>/etc/sysctl .conf
sysctl
-p

cat> /etc/haproxy/haproxy.cfg << EOF
global
log
127.0.0.1 local3 info
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect
5000
timeout client
50000
timeout server
50000
frontend k8s_api
mode tcp
bind
*:16443
default_backend k8s_api

backend k8s_api
mode tcp
balance roundrobin
server k8s150
192.168.0.150:6443 check
server k8s151
192.168.0.151:6443 check

listen stats
mode http
bind
0.0.0.0:1080
stats enable
stats hide
-version
stats uri
/stats
stats realm Haproxy\ Statistics
stats auth admin:admin123
stats admin
if TRUE
EOF

systemctl enable haproxy.service
systemctl restart haproxy.service
systemctl status haproxy.service
netstat
-lnt | grep -E "16443|1080"

< pre>yum instally haproxy

##Ignore VIP

echo net.ipv4.ip_nonlocal_bind = 1 >>/etc/sysctl .conf

sysctl
p

cat> /etc/haproxy/haproxy.cfg << EOF

global

log
127.0.0.1 local3 info

chroot /var/lib/haproxy

user haproxy

group haproxy

daemon

defaults

log global

mode http

option httplog

option dontlognull

timeout connect
5000

timeout client
50000

timeout server
50000

frontend k8s_api

mode tcp

bind
*:16443

default_backend k8s_api

backend k8s_api

mode tcp

balance roundrobin

server k8s150 192.168.0.150:6443 check

server k8s151
192.168.0.151:6443 check

listen stats

mode http

bind 0.0.0.0:1080

stats enable

stats hide
version

stats uri
/stats

stats realm Haproxy\ Statistics

stats auth admin:admin123

stats admin
if TRUE

EOF

systemctl enable haproxy.service

systemctl restart haproxy.service

systemctl status haproxy.service

netstat -lnt | grep -E 16443|1080

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2389 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.