gosquared / redis-clustr

Redis Cluster client for Node.js
MIT License
107 stars 25 forks source link

config command is an object not a function #20

Open geogeim opened 7 years ago

geogeim commented 7 years ago

i'm unable to call the config command to configure the redis server because (new RedisClustr()).config is not a function

jbt commented 7 years ago

Hi @geogeim - good spot that the config function is being shadowed by the config object on the instance itself.

I guess one problem with commands like CONFIG in a cluster environment is: what should they do? Since they're obviously not commands against a particular redis key, there's no natural instance in the cluster they should be sent to. Would you expect the command to be sent to every instance in the cluster?

geogeim commented 7 years ago

i am using this method for setting flags to enable keyspace notifications redisPub.config('SET', "notify-keyspace-events", "Ex"); in this case the command should be sent to all of the servers, but i don't think this applies to all cases. my suggestion would be to have a mechanism to enumerate the servers in the cluster and with this the user can set the configuration per server

edit: found this https://github.com/luin/ioredis#running-commands-to-multiple-nodes