【发布时间】:2020-08-23 19:32:36
【问题描述】:
有大量示例和资源可用于连接到 redis “服务器”,但不能连接到 redis “集群”。
我目前拥有的是:
const redis = require("redis");
const client = redis.createClient({
port : 6379, // replace with your port
host : '10.0.0.100', // replace with your hostanme or IP address
password : 'Notforyou', // replace with your password
// optional, if using SSL
// use `fs.readFile[Sync]` or another method to bring these values in
tls : {
key : stringValueOfKeyFile,
cert : stringValueOfCertFile,
ca : [ stringValueOfCaCertFile ]
}
});
但这是针对单个 redis 服务器而不是集群。我将如何连接到我的集群?
【问题讨论】:
标签: node.js redis redis-cluster