Redis 企业集群命令错误“CLUSTER" [英] Redis Enterprise Clustering Command Error 'CLUSTER'
问题描述
我们刚刚安装了 Redis Enterprise 并在数据库上设置了一些配置.
We just installed Redis Enterprise and set some configuration on the database.
我们创建了一个简单的脚本,因为在我们的应用程序上 cluster 命令不起作用,这是正确的,它不起作用:
We create a simple script becase on our app the cluster command doesn't work, and that's correct it doesn't work:
var RedisClustr = require('redis-clustr');
var redis = new RedisClustr({
servers: [
{
host: 'URL',
port: 18611
}
],
redisOptions: {
password: 'ourpassword'
}
});
redis.get('KSHJDK', function(err, res) {
console.log(res, err);
});
外壳错误:
undefined Error: couldn't get slot allocation'
at tryClient (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/src/RedisClustr.js:194:17)
at /Users/machine/Sites/redis-testing/node_modules/redis-clustr/src/RedisClustr.js:205:16
at Object.callbackOrEmit [as callback_or_emit] (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/lib/utils.js:89:9)
at RedisClient.return_error (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:706:11)
at JavascriptRedisParser.returnError (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:196:18)
at JavascriptRedisParser.execute (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:572:12)
at Socket.<anonymous> (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:274:27)
at Socket.emit (events.js:321:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9) {
errors: [
ReplyError: ERR command is not allowed
at parseError (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:193:12)
at parseType (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:303:14) {
command: 'CLUSTER',
args: [Array],
code: 'ERR'
}
]
}
我们是否遗漏了一些配置?我们不知道是集群错误还是 Redis Enterprise 错误.
Are we missing something on the configuration? We don't know if its an error con the clustering or on Redis Enterprise.
推荐答案
Redis Enterprise 支持两种集群风格.对于常规 OSS 集群,您需要一个像您使用的那样的集群感知客户端.您使用的是非-集群感知客户端,您应该将它与常规客户端一起使用(就像您连接到单个Redis进程一样).
Redis Enterprise supports two clustering flavors. With regular OSS cluster you need a cluster aware client like the one you use. The one you are using is for non-cluster aware clients, you should use it with regular client (as if you are connecting to a single Redis process).
这篇关于Redis 企业集群命令错误“CLUSTER"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!