我正在使用 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连接
您可以使用
valkey-cli
(或 redis cli
)进行连接吗?MemoryDB
默认使用 TLS,并且您似乎没有将客户端配置为使用 TLS
,这可能是问题所在。
只是一个报价 - Glide