Help me please, i try HAproxy on my computer with VMware

i still try common HAproxy configuration on my computer, after i have stupid problem because my fault before now i have another problem. and here is my servers configuration. this is OFFLINE and using LOCALHOST.

server1 using IP: 10.10.10.2/29
server2 using IP: 10.10.10.3/29
server3 using IP: 10.10.10.4/29
all server using host name: jarkom

my load balancing using IP: 172.23.23.5/29

my firewall and connection i think on good condition because all of them can pinging each other.

and here my HAproxy script:

root@ubuntu:/home/jarkom# cat /etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local0 notice
maxconn 2000
user jarkom
group jarkom
daemon

defaults
mode http

frontend http-in
bind 172.23.23.5:80
default_backend webservers
timeout connect 100
timeout client 100
timeout server 100

backend webservers
server web01 10.10.10.2:80
server web02 10.10.10.3:80
server web03 10.10.10.4:80
balance roundrobin
timeout connect 100
timeout client 100
timeout server 100

and then when this error show to meā€¦

ā— haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-09-15 21:39:07 WIB; 2min 51s ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 3928 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS)
Main PID: 3929 (haproxy)
Tasks: 2 (limit: 2307)
CGroup: /system.slice/haproxy.service
ā”œā”€3929 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
ā””ā”€3930 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid

Sep 15 21:39:07 ubuntu systemd[1]: Starting HAProxy Load Balancerā€¦

Sep 15 21:39:07 ubuntu haproxy[3929]: [WARNING] 257/213907 (3929) : parsing [/etc/haproxy/haproxy.cfg:14] : ā€˜timeout connectā€™ will be ignored because frontend ā€˜http-inā€™
Sep 15 21:39:07 ubuntu haproxy[3929]: [WARNING] 257/213907 (3929) : parsing [/etc/haproxy/haproxy.cfg:16] : ā€˜timeout serverā€™ will be ignored because frontend ā€˜http-inā€™
Sep 15 21:39:07 ubuntu haproxy[3929]: [WARNING] 257/213907 (3929) : parsing [/etc/haproxy/haproxy.cfg:24] : ā€˜timeout clientā€™ will be ignored because backend 'webservers
Sep 15 21:39:07 ubuntu systemd[1]: Started HAProxy Load Balancer.

when i try on browser, i check with load balancing IP but that is error ā€œ503ā€ thats said cant reach server.

can someone explain me what wrong with my work?.. i will be appreciate if u tell me where is the wrongā€¦ thanks a lot for your attention and i hope god will be with u foreverā€¦ :innocent:

Hi Grooth,

Firstly, the errors you see about timeoutā€™s is because they are declared in the frontend too, nothing to worry about though as these are just warnings.

The bigger issue for me would be proving the availability of the real servers, can you connect to

server web01 10.10.10.2:80
server web02 10.10.10.3:80
server web03 10.10.10.4:80

Using curl/wget from the box running HAProxyā€¦? Because you have no health check defined itā€™s hard to know if itā€™s even really accessible.

1 Like

i think, i have problem with my connection configuration or on my xampp configuration because when i do health check this is happen:

jarkom@ubuntu:~$ curl 10.10.10.2
curl: (7) Failed to connect to 10.10.10.2 port 80: No route to host

jarkom@ubuntu:~$ wget 10.10.10.2
ā€“2018-09-24 02:03:06-- http://10.10.10.2/
Connecting to 10.10.10.2:80ā€¦ failed: No route to host.

jarkom@ubuntu:~$ wget 172.23.23.5
ā€“2018-09-24 02:05:33-- http://172.23.23.5/
Connecting to 172.23.23.5:80ā€¦ connected.
HTTP request sent, awaiting responseā€¦ 503 Service Unavailable
2018-09-24 02:05:33 ERROR 503: Service Unavailable.

thanks for reply my question your respond very helpful.
so if u see that health check, what is wrong?.. my server or my connection? thanks before.