Install and Configure HaProxy LBR- Failed-curl is success

Hi Team, @player001 @Inderpreet @KodeKloud @kodekloud-support3

I have done below steps. But its failed. Can you check anything missing here?

my mail : selvalingam29@gmail.com

Configuration

yum -y install haproxy

vi /etc/haproxy/haproxy.cfg

frontend Local_Server
bind 172.16.238.14:80
mode http
default_backend My_Web_Servers

backend My_Web_Servers

mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
option httpchk HEAD / HTTP/1.1rnHost:localhost
server stapp01.stratos.xfusioncorp.com  172.16.238.10:6300
server stapp02.stratos.xfusioncorp.com  172.16.238.11:6300
server stapp03.stratos.xfusioncorp.com  172.16.238.12:6300 

Validate

haproxy -c -f /etc/haproxy/haproxy.cfg

Configuration validation after changes. verified before restart.

Curl is success in all server.

Able to see output in port.

#systemctl status httpd

Am able to curl from all server and LBR server.

but failed like below.

@Inderpreet @player001 any help/update here? Thanks

@Inderpreet @player001 i have completed all steps correctly. am able to test with curl and web page as well. but still its failed. added my steps in above screenshots . could you please check anything missing?

KKE team will look into this. Wait for their response.

1 Like

@Inderpreet @KodeKloud @kodekloud-support3 Team, Any update on this.? I believe this task is marked as failed wrongly. Can anyone check this please? thanks.

I got same task again . Its success now . unlucky no one respond previous failure @Inderpreet @KodeKloud @kodekloud-support3

Below steps worked for me

in app servers

cat /etc/httpd/conf/httpd.conf| grep Listen --> to check httpd port to configure in LBR
systemctl enable httpd && service httpd start && service httpd status


LBR server

yum -y install haproxy
cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bkp
cat /etc/haproxy/haproxy.cfg | grep haproxy/stat
vi /etc/haproxy/haproxy.cfg


frontend  main *:**80**
        acl url_static       path_beg       -i /static /images /javascript /stylesheets
        acl url_static       path_end       -i .jpg .gif .png .css .js

        use_backend static          if url_static
        default_backend             **app**

backend **app**
        balance roundrobin
        server stapp01 172.16.238.10:8085 check
        server stapp02 172.16.238.11:8085 check
        server stapp03 172.16.238.12:8085 check


To validate

haproxy -f /etc/haproxy/haproxy.cfg
systemctl enable haproxy && service haproxy start && service haproxy status


to Validate LBR and all app servers

curl 172.16.238.10:8085
curl 172.16.238.11:8085
curl 172.16.238.12:8085
curl 172.16.238.14:80

image

1 Like