0

We just installed Redis Enterprise and set some configuration on the database.

enter image description here

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);
});

Error on the shell:

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'
    }
  ]
}

Are we missing something on the configuration? We don't know if its an error con the clustering or on Redis Enterprise.

Ulises
  • 406
  • 7
  • 22

1 Answers1

1

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).

Ofir Luzon
  • 10,635
  • 3
  • 41
  • 52