Description
Description
const addresses: LookupAddress[] = await new Promise((resolve, reject) => { dns.lookup( "wso2-authentication-service-redis-service", dnsOptions, (err, addresses) => { if (err) { console.error("DNS resolution error:", err); reject(err); } else { console.log("Resolved addresses:", addresses); resolve(addresses as LookupAddress[]); } }, ); });
console.log("addresses", addresses);
Resolved addresses: [
{ address: '100.64.128.230', family: 4 },
{ address: '100.64.42.138', family: 4 },
{ address: '100.64.62.26', family: 4 }
]
const sentinelClient = await createSentinel({
name: "wso2-authentication-service",
sentinelRootNodes: addresses.map((address) => ({
host: address.address,
port: 6379,
})),
})
.on("reconnecting", () => {
console.log("Redis sentinel reconnecting");
})
.on("error", (err) => {
console.error(`Client Redis sentinel connection error: ${err}`);
throw new Error(`Client Redis sentinel connection error: ${err}`);
})
.on("ready", () => {
console.log("Redis sentinel connection is ready");
})
.connect();
console.log(sentinelClient.isReady); **// true**
console.log(sentinelClient.isOpen); **// true**
const res = await sentinelClient.use(async (client) => {
try {
const value = await client.get("dfsf");
console.log("value", value);
return value;
} catch (error) {
console.error("Error in sentinelClient.use", error);
**Error in sentinelClient.use[SimpleError: ERR unknown command 'GET', with args beginning with: 'key' 'dfsf' ]**
}
});`
Please help me fix this issue.
PS. I tried to find workarounds like using .acquire, .getMasterNode, and .createClient right after, but it complains about calling basic Redis client methods such as .get and .set.
Node.js Version
v22.14.0
Redis Server Version
Redis server v=7.2.7 sha=00000000:0 malloc=libc bits=64 build=7f24f11dd7e42c58
Node Redis Version
^5.0.1
Platform
No response