我想在AWS上使用Redis。我的开发环境依赖于Skaffold和Kubernetes。
我的安全组配置是:


我的Redis配置是这样的:

我想从Kubernetes pods在我的nodeJS应用程序上连接这个Redis,所以,我的代码如下所示:
let statsQueue = new Queue('statistics', '<Primary-Endpoint-On-AWS-Redis');但是我得到了这个错误:
triggerUncaughtException(err, true /* fromPromise */);
^
Error: connect EINVAL 0.0.24.235:6379 - Local (0.0.0.0:0)
at internalConnect (node:net:909:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:431:12)
at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1055:9)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:8) {
errno: -22,
code: 'EINVAL',
syscall: 'connect',
address: '0.0.24.235',
port: 6379
}为什么我会得到这个错误?ı如何解决这个问题?
发布于 2021-04-07 17:04:55
从URL添加Redis://解决的错误。
所以连接就像这样:让statsQueue = new Queue('statistics',‘Redis://
https://stackoverflow.com/questions/66981605
复制相似问题