zoukankan      html  css  js  c++  java
  • upstream timed out (10060: A connection attempt failed because the connected party did not properly respond

    openresty 错误日志报错内容:

    2019/01/22 11:58:10 [error] 12504#15104: *547160484 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 10.4.101.11, server: localhost, request: "GET /xxx.jsp HTTP/1.1", upstream: "http://[::1]:8080/xxx.jsp", host: "10.1.3.42", referrer: "http://10.1.3.42/xxxindex.jsp"
    2019/01/22 12:00:44 [error] 12504#15104: *547194371 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 10.4.101.11, server: localhost, request: "GET /xxx.jsp HTTP/1.1", upstream: "http://[::1]:8080/xxx.jsp", host: "10.1.3.42", referrer: "http://10.1.3.42/xxxxxex.jsp"

    nginx.conf配置如下:

        upstream tomcat {
            server localhost:9999 weight=1 max_fails=5;       
            server localhost:8080 weight=9 max_fails=5;
            server 10.1.3.43:8080 weight=9 max_fails=5;
            ip_hash;
        }
        
        upstream file_tomcat {
            server localhost:9999 weight=1 max_fails=5;       
            server localhost:8080 weight=9 max_fails=5;
            ip_hash;
        }

    报错信息中看到:

    upstream: "http://[::1]:8080/xxx.jsp

    显然是 localhost 使用了 IPV6 去访问,导致出现问题。

    将 locaohost改成 127.0.0.1 即可:

        upstream tomcat {
            server 127.0.0.1:9999 weight=1 max_fails=5;       
            server 127.0.0.1:8080 weight=9 max_fails=5;
            server 10.1.3.43:8080 weight=9 max_fails=5;
            ip_hash;
        }
        
        upstream file_tomcat {
            server 127.0.0.1:9999 weight=1 max_fails=5;       
            server 127.0.0.1:8080 weight=9 max_fails=5;
            ip_hash;
        }
  • 相关阅读:
    java数据结构之队列
    java数据结构之线性表
    habase 报错 ERROR: Can't get master address from ZooKeeper; znode data == null
    java.io.IOException: Could not find status of job:job_1534233312603_0002
    windows本地调试安装hadoop(idea) : ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path
    搭建hadoop_之 创建3个虚拟机配置好网络
    java 数组
    java 中break 和continue 的非常规用法
    java运算符
    java数据类型
  • 原文地址:https://www.cnblogs.com/digdeep/p/10305143.html
Copyright © 2011-2022 走看看