Haproxy 503服务不可用,没有服务器可用于处理此请求

问题描述 投票:0回答:1

我有平衡主机

192.168.1.12

接收输入的HTTP / HTTPS流量

和后端的平衡

10.0.1.12
10.0.1.13

使用

HA-Proxy version 1.8.4-1deb90d 2018/02/08

config

global
    log         127.0.0.1 local2

    chroot  /var/opt/rh/rh-haproxy18/lib/haproxy
    pidfile     /var/run/rh-haproxy18-haproxy.pid
    maxconn     20000
    daemon

    # turn on stats unix socket
    stats socket /var/opt/rh/rh-haproxy18/lib/haproxy/stats

defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          15s
    timeout server          15s
    timeout http-keep-alive 5s
    timeout check           3s
    maxconn                 20001

frontend http_frontend
    bind *:80
    default_backend http_backend

backend http_backend
    mode http
    server server1 10.0.1.12:8081 check
    server server1 10.0.1.13:8081 check

开始服务正常

检查卷曲

# curl -iv 10.0.1.12:8081
# curl -iv 10.0.1.13:8081

返回确定

为什么卷曲http://localhost

返回503服务不可用没有服务器可用于处理此请求。

load-balancing haproxy
1个回答
0
投票

这是我的haproxy.cfg文件,希望这将帮助您解决问题。

# Nur Load Balancer #

frontend tomcat-service
        bind *:8081
        default_backend tomcat-server
        mode http

backend tomcat-server
        balance roundrobin
        server mfsys-cm-01 192.168.10.31:8080 check
        server mfsys-cm-02 192.168.10.30:8080 check

listen stats
        bind *:8082
        stats enable
        stats hide-version
        stats show-node
        stats uri /stats
        stats auth admin:mypassword
        stats refresh 5s

访问统计信息时出现相同的错误,解决方案很简单,我没有提供正确的URL,因为它应该是http://192.168.10.1:8082/stats

© www.soinside.com 2019 - 2024. All rights reserved.