大网数据广告活动
服务器运维问答

HAProxy Cannot Connect to Backend (No Route to Host)

· 52CE 我爱测

I couldn't make the proxy work for one of our websites (IIS7). I am getting a "no route to host" message from the haproxy logs. Server test_be/10.100.1.1:81 is DOWN, reason: Layer4 connection problem, info: "No route to host", ch…

问题原文

原帖链接 · Ianthe the Duke of Nukem · CC BY-SA 3.0

I couldn't make the proxy work for one of our websites (IIS7). I am getting a "no route to host" message from the haproxy logs.

    Server test_be/10.100.1.1:81 is DOWN, reason: 
    Layer4 connection problem, info: "No route to host", 
    check duration: 1000ms. 0 active and 0 backup servers left. 
    0 sessions active, 0 requeued, 0 remaining in queue.

    backend test_be has no server available!

Here's what I found so far:

  • No firewalls are active in both machines.
  • ping, tracepath and telnet work.
  • Curl-ing from the haproxy machine is successful like: http://10.100.1.1:81/test.html returns value
  • haproxy frontend/backend config (does not work):

    frontend test
        bind 10.100.2.2:80
        mode http
        option httplog
        default_backend test_be
    
    backend test_be
        option httpchk
        balance source
        server s1 10.100.1.1:81 check port 81
    
  • haproxy alternative config (that works):

    listen test_direct
        bind 10.100.2.2:80
        mode tcp
        option tcplog
        balance source
        server s1 10.100.1.1:81
    
  • Other IIS website backends work as well.

Can you please help me understand why the frontend/backend setup doesn't work? I want to use it because I want to put additional rules based on requests coming in. Could it perhaps be due to health checks not being satisfied? (I actually don't know exactly how that happens.)

I'm splitting my hairs here.

已采纳解答

原帖链接 · Flash · CC BY-SA 3.0

Haproxy requests a valid return from the IIS server (http 200/300), in your case I am guessing it returns a 404 since a default index page does not exist. You may also want to add the url you wish to check (/test.html) to the httpchk config line.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。