惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
H
Help Net Security
博客园 - 叶小钗
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
Martin Fowler
Martin Fowler
月光博客
月光博客
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
Vercel News
Vercel News

博客园 - Tinywan

响应错误: Indirect modification of overloaded element of app\model\StudentCacheModel has no effect - Tinywan Ubuntu 22.04 编译安装 PHP 7.4.33 报错:make: *** [Makefile:749: ext/openssl/openssl.lo] Error 1 how to set mpdf HTML contains invalid UTF-8 character(s) 和 CPU 100% Redis Docekr WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition Nginx添加第三方模块,出现“is not binary compatible in”错误的解决方案 Docker 数据库连接见解异常 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again 解决mysql死锁问题 SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction Java系列 | 如何讲自己的JAR包上传至阿里云maven私有仓库【云效制品仓库】 Redis系列 | 分类树查询功能如何从2s优化到0.1s Docker系列 | docker endpoint for “default” not found Node系列 | Node版本管理工具 fnm Java系列 | IntelliJ IDEA 如何导入和使用一个Jar包 Chrome扩展插件:Console Importer(控制台导入器) PHP系列 | mPdf字体库异常 Cannot find TTF TrueType font file "Eeyek.ttf" in configured font directories PHP系列 | PHP中的stdClass是什么? 网络安全 | 记录一次acme.sh更新证书 Error add txt for domain:_acme-challenge.tinywan.com 大数据系列 | 阿里云datav数据可视化(使用json文件生成可视化动态图标) Java系列 | Linux系统中运行JMeter脚本 PHP系列 | TP6使用表达式设置数据 Db::raw('end_time')
Docker系列 | SQLSTATE[HY000] [2002] php_network_getaddres...
Tinywan · 2022-05-12 · via 博客园 - Tinywan

错误日志

[2022-05-12 16:53:01][error] [数据驾驶舱] 命令行任务异常,SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768
[2022-05-12 16:54:06][error] [数据驾驶舱] 命令行任务异常,SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768
[2022-05-12 16:59:12][error] [数据驾驶舱] 命令行任务异常,SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768
[2022-05-12 17:14:32][error] [数据驾驶舱] 命令行任务异常,SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768
[2022-05-12 17:15:34][error] [数据驾驶舱] 命令行任务异常,SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768

关键是这个错误是偶尔的,一次可以一次又不可以

以上数据库连接是使用的阿里云RDS 外网地址如:rm-xxxxxxxxxxx.mysql.rds.aliyuncs.com

进入容器

# ping rm-xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com
ping: bad address 'rm-xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com'

# ping rm-xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com
ping: bad address 'rm-xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com'

 发现容器内没法ping通

解决方案:优化 DNS 解析  

在请求域名时,DNS 解析可能会超时或者失败导致网站无法访问

Linux

/etc/docker/daemon.json

"dns" : ["114.114.114.114","8.8.8.8"]

Windows  

Docker Desktop 配置文件增加DNS,设置docker启动配置。增加以下配置

  "dns": [
    "114.114.114.114",
    "8.8.8.8"
  ],

 增加后重启Docker,解决问题