Install and configure HaProxy LBR - failed

@mmumshad and @Inderpreet

I am not sure what has gone wrong again with the backend system, and for the last time will ask kodekloud team’s support please recorrect the scores? this is the third time I am losing scores for no obvious reason and no one is even replying?!!

this is what I have done:
1- ssh to the three app servers and checked which port the http is running on:
cat /etc/httpd/conf/httpd.conf | grep Listen
the port was
Listen 3004

2- ssh to alb server and Installed HAProxy on ALB server
yum -y install haproxy
systemctl status haproxy
systemctl start haproxy

3- configured HAProxy as per requirements:
vi /etc/haproxy/haproxy.cfg

#------------------------------------
# FrontEnd Configuration
#------------------------------------
frontend main
    bind *:80
    option http-server-close
    option forwardfor
    default_backend app-main

- Make sure you get the http port of all app. And use it with backend server details as below:
#---------------------------------------------------------------------
# BackEnd roundrobin as balance algorithm
#-----------------------------
backend app-main
    balance roundrobin     #Balance algorithm
    server stapp01  172.16.238.10:3004 check  
    server stapp02  172.16.238.11:3004 check  
        server stapp03  172.16.238.12:3004 check 


save the file and restarted HAPRoxy
systemctl restart haproxy

couldn’t get the page running on from the browser, not sure why and what I have done wrong, I have done this task two more time and had no issue. could you please review this and let me know why this has failed?

1 Like

Hint: are you sure your have your targets configured properly? Proper host and port?

@vennemp Do you see any issue with what i have configured there?

Idk what you were “assigned” but. If a load balancer isn’t returning traffic. Either you are browsing on wrong port. Or you are forwarding to to wrong ip/dns name, or forwarding to wrong port.

Are the servers you are targeting actually listening on 3004?

@vennemp please check the images i attached to the topic.

Have you make it enable the service in all app server?

@Tej-Singh-Rana
I havent checked if httpd is running because i am assuming that must already be running. Since thats not anyhow in the scope of this task. If so then the title is misleading and the task name should be changed.

This statement is entirely wrong. The point is to configure the load balancer with the application. If you aren’t willing to confirm the configuration of the targets and the ports of the application then you simply will not solve this assignment. You cant just put random stuff in a Config file and then expect things to work. Ssh into the target app servers and poke around. And you will see. Idk what your targets should be bc I’ve seen them change enough stuff from assignment to assignment that it’s impossible For anyone to know except you.

@vennemp i dono why you are defensive and agressive. If you are not willing to see the screenshoots that i have checked the three app servers and got the ports then no need to reply and get grumpy. None of these are your issues and your business and i havent tagged you to help me.
May i please ask you to read my topic then reply. Dont just reply without reading properly.

Nobody is grumpy. I simply told you what you need to do and figure out the problem yourself. And instead you just want me to answer it. I don’t have access to your command line.

I looked at the posts. My comment stands. You have two people who clearly have solved this assignment tell you what needs to be done and you just respond by saying “please help me”. We did.

@vennemp i solved this assignment twice already. Not that i dont know. And i never asked you to solve it for me. I already solved it i asked kodekloud team to see what went wrong. Dono whats your problem interfering mate!!

@nashwan exact steps worked for me. Thanks for detailed info. Hope you also got through it.