ioredis - ClusterAllFailedError:无法刷新 Redis 集群的插槽缓存问题以连接 AWS MemoryDb

问题描述 投票:0回答:1

我正在使用 redis 集群与 memoryDB aws 连接

const connection = new Redis.Cluster(
  [{ host: "clustercfg.jb-bot-dev-memorydb.czxa87.memorydb.ap-south-1.amazonaws.com", port: 6379}],
  {
    redisOptions: {
      password: "memorydb@12345678"
    },
  }
);

connection.on("ready", () => {
  console.log("Redis Client Ready");
});
connection.on("connect", () => {
  console.log("Redis Client Connected");
});
connection.on("error", (error) => {
  console.log("Redis Client Connection Error", error);
});

错误:

ClusterAllFailedError: Failed to refresh slots cache. at tryNode (/usr/src/app/node_modules/ioredis/built/cluster/index.js:308:31) at /usr/src/app/node_modules/ioredis/built/cluster/index.js:325:21 at Timeout.<anonymous> (/usr/src/app/node_modules/ioredis/built/cluster/index.js:662:24) at Timeout.run (/usr/src/app/node_modules/ioredis/built/utils/index.js:117:22) at listOnTimeout (internal/timers.js:559:11) at processTimers (internal/timers.js:500:7) { lastNodeError: Error: timeout at timeout (/usr/src/app/node_modules/ioredis/built/utils/index.js:120:38) at EventEmitter.getInfoFromNode (/usr/src/app/node_modules/ioredis/built/cluster/index.js:659:67) at tryNode (/usr/src/app/node_modules/ioredis/built/cluster/index.js:314:19) at EventEmitter.refreshSlotsCache (/usr/src/app/node_modules/ioredis/built/cluster/index.js:333:9) at /usr/src/app/node_modules/ioredis/built/cluster/index.js:167:22 }

将redis与aws的memoryDB连接

node.js amazon-web-services redis bullmq amazon-memory-db
1个回答
0
投票

您可以使用

valkey-cli
(或
redis cli
)进行连接吗?
该问题似乎是连接问题,客户端无法从服务器获得响应并刷新插槽,这是客户端通常创建集群拓扑的第一步的一部分。
MemoryDB
默认使用 TLS,并且您似乎没有将客户端配置为使用
TLS
,这可能是问题所在。 只是一个报价 - Glide

© www.soinside.com 2019 - 2024. All rights reserved.