blank的编程之路


  • 首页

  • 归档

  • 搜索
consul atomikos mybatisplus druid nexus nas named bind mysqldump acme.sh Dockerfile rsync keepalived swarm kibana ubuntu linux scp bugfix https ssl certbot curl gogs adminer harbor yum portainer python kubernetes idea java springboot maven docker-compose redis nginx mysql brew git chocolatey jenkins elasticsearch docker haproxy rabbitmq centos

记一次生产网站访问异常的锅

发表于 2020-04-16 | 分类于 运维 | 0 | 阅读次数 276

公司生产网站访问异常表现为

  1. 有时刷新 接口 404
  2. 有时又正常
  3. 有时正常但非常慢的问题

产生查看服务器 docker 运行 状态也都是 健康正常

查看 nginx 错误日志发现 大量如下请求失败日志

2020/04/16 11:22:24 [error] 7#7: *295 connect() failed (110: Connection timed out) while connecting to upstream, client: x, server: x.com, request: "GET /user/info?_=1587007211786 HTTP/2.0", upstream: "http://x:84/user/info?_=1587007211786", host: "x.com", referrer: "https://x.com"

因生产配置了 nginx 的负载均衡,进一步查看 配置

   #backend springboot for api
    upstream w{
      	ip_hash;
    	server n1.x.com:84;
        server n2.x:84;
        server n3.x.com:84;
	# 问题出此在这行 r.x.com 服务器已过期
        server r.x.com:84;
    }

由此得出 在前端向后端接口发送请求时 如果随机到 此过期不能访问的 API [r.x.com:84] 接口 则出现网站访问异常
移除此行后重启 nginx 发现访问正常 接口都能快速响应了

  • 本文作者: blank
  • 本文链接: https://blankhang.com/2020/04/16/201904161158
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
# consul # atomikos # mybatisplus # druid # nexus # nas # named # bind # mysqldump # acme.sh # Dockerfile # rsync # keepalived # swarm # kibana # ubuntu # linux # scp # bugfix # https # ssl # certbot # curl # gogs # adminer # harbor # yum # portainer # python # kubernetes # idea # java # springboot # maven # docker-compose # redis # nginx # mysql # brew # git # chocolatey # jenkins # elasticsearch # docker # haproxy # rabbitmq # centos
CentOS7 安装 Bind + Nginx 配置私有网络的 DNS
IDEA 提高编码效率优化
© 2021 blank
Everything is energy and everything has a frequency