【问题标题】:curl: (7) Failed connect to 35.229.60.183:80; (vm on google clould) Connection refusedcurl: (7) 连接到 35.229.60.183:80 失败; (谷歌云上的虚拟机)连接被拒绝
【发布时间】:2018-09-23 18:55:21
【问题描述】:

Linux 世界的新手。

我已经设置了两台 apache 网络服务器,一台 haproxy 和一台 testpc。 我能够使用端口 80 上的 index.html 内容来卷曲 Web 服务器。 但是当我尝试在任何端口或端口 80 上卷曲 haproxy 时,我会卷曲:

(7) 连接到 35.229.60.183:80 失败;连接被拒绝

所有服务器的防火墙都关闭了,重启了haproxy。

haproxy 配置文件:

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          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           100s
    maxconn                 3000

frontend myserver
bind *:80
default_backend mybackendserver

mybackendserver
 balance roundrobin
 mode http
 server webserver       35.185.18.206:80        check
 server webserver1      35.231.241.247:80       check

当我尝试在我的测试机器中卷曲它们时,我正在卷曲:

(7) 连接到 35.229.60.183:80 失败;连接被拒绝

35.​​229.60.183是我的haproxy服务器的ip。

【问题讨论】:

    标签: apache webserver haproxy


    【解决方案1】:

    如果我没记错的话,您应该直接从 Google Cloud 控制面板启用端口 :80 或您使用的任何端口。

    Check this out.

    【讨论】:

    • 我已经做到了。 apache 网络服务器在端口 80 上工作正常。但不是 haproxy。
    • @stalin service haproxy status 返回什么?
    • ● haproxy.service - HAProxy 负载均衡器已加载:已加载(/usr/lib/systemd/system/haproxy.service;已启用;供应商预设:已禁用)活动:失败(结果:退出代码)自 2018 年 9 月 23 日星期日 01:18:32 UTC 起; 3s 前 进程:1187 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)跨度>
    • 如您所见Active: failed。这意味着您的 HAProxy 设置有问题。
    • 谢谢。是的,我可以。如果我能解决这个问题,让我试试。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-22
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 2021-01-27
    • 2019-10-31
    • 1970-01-01
    相关资源
    最近更新 更多