gpt4 book ai didi

node.js - Amazon Ec2 服务器上的数据库连接丢失

转载 作者:太空宇宙 更新时间:2023-11-03 23:39:41 25 4
gpt4 key购买 nike

在过去的几个月里,我遇到了一个问题,我在亚马逊 ec2 服务器上部署了我的应用程序,但每天至少有 10 到 30 次出现这些错误。

1) Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)

2) Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
--------------------
at Handshake.Sequence (/var/app/current/node_modules/mysql/lib/protocol/sequences/Sequence.js:15:20)
at new Handshake (/var/app/current/node_modules/mysql/lib/protocol/sequences/Handshake.js:9:12)
at Protocol.handshake (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:42:50)
at Connection.connect (/var/app/current/node_modules/mysql/lib/Connection.js:72:18)
at module.exports.connect (/var/app/current/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:276:16)
at Object.pool.Pooling.Pool.create (/var/app/current/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:125:19)
at createResource (/var/app/current/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:258:13)
at dispense (/var/app/current/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:250:9)
at Object.me.acquire (/var/app/current/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:316:5)
at module.exports.enqueue (/var/app/current/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:320:19)

3) TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at EventEmitter.emit (events.js:74:15)
at Handshake._callback (/var/app/current/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:286:19)
at Handshake.Sequence.end (/var/app/current/node_modules/mysql/lib/protocol/sequences/Sequence.js:75:24)
at Protocol.handleNetworkError (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:238:14)
at Connection._handleNetworkError (/var/app/current/node_modules/mysql/lib/Connection.js:155:18)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:830:16
at process._tickDomainCallback (node.js:459:13)

知道如何解决这些问题吗?

在在这里发帖之前,我也在 github 上发布了类似的问题,但我得到的答案并不令人满意,这是一个亚马逊问题,很多人都面临着这个问题。

那么大家对这个问题有什么建议或解决方案吗?

最佳答案

你的错误号2是我几天前被困的地方,我通过clouddueling找到了解决方案, 这里 https://github.com/aws/aws-sdk-js/issues/55

如果您没有遇到亚马逊问题,希望这对您有所帮助。

关于node.js - Amazon Ec2 服务器上的数据库连接丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26173442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com