Welcome to the Linux Foundation Forum!

Lab 16.2 Cannot make Lode Balancer work

andreizimin
andreizimin Posts: 3
edited April 2021 in LFS258 Class Forum

On step 3, when I restart and check the status of HAProxy Load Balancer, it returns status as "Failed"
What am I doing wrong? Thank you!

Here are the command and the output:

student@ha-proxy:~$ sudo systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Mon 2021-04-05 08:01:41 UTC; 10min ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 21065 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f ${CONFIG} -p /run/haproxy.pid $EXTRAOPTS (code=exited, status=0/SUCCESS)
Process: 21055 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=0/SUCCESS)
Main PID: 21065 (code=exited, status=0/SUCCESS)

Apr 05 08:01:41 ha-proxy haproxy-systemd-wrapper[21065]: haproxy-systemd-wrapper: exit, haproxy RC=256
Apr 05 08:01:41 ha-proxy systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Apr 05 08:01:41 ha-proxy systemd[1]: Stopped HAProxy Load Balancer.
Apr 05 08:01:41 ha-proxy systemd[1]: haproxy.service: Start request repeated too quickly.
Apr 05 08:01:41 ha-proxy systemd[1]: Failed to start HAProxy Load Balancer.
Apr 05 08:01:41 ha-proxy systemd[1]: haproxy.service: Unit entered failed state.
Apr 05 08:01:41 ha-proxy systemd[1]: haproxy.service: Failed with result 'start-limit-hit'.

Here is my haproxy.cfg file:

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon

    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

    ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
    ssl-default-bind-options no-sslv3

defaults
log global
mode tcp
option tcplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http

frontend proxynode
bind *:80
bind *:6443
stats uri /proxystats
default_backend k8sServers

backend k8sServers
balance roundrobin
server master 10.2.0.14:6443 check

listen stats
bind :9999
mode http
stats enable
stats hide-version
stats uri /stats

Comments

  • chrispokorni
    chrispokorni Posts: 2,155

    Hi @andreizimin,

    Without the code formatting tags it is difficult to say if your haproxy.cfg file is correct. Compare the /etc/haproxy/haproxy.cfg file from the ha-proxy server with the file with the same name found in the SOLUTIONS tarball, to ensure it is accurate.

    You may try to uninstall the haproxy, then install it again. Prior to step 2, check the status of the haproxy.service, and confirm it is running. Then proceed with steps 2 and 3 again.

    If the restart command does not work, try a service stopfollowed by a service start instead.

    Regards,
    -Chris

Categories

Upcoming Training