-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lua function not execute on readonly slave node #197
Comments
Could you please post your code here that can reproduce the problem? |
var Redis = require('ioredis');
var r1 = "x.x.x.x";
var r1s = "x.x.x.x";
var r2 = "x.x.x.x";
var r2s = "x.x.x.x";
var r3 = "x.x.x.x";
var r3s = "x.x.x.x";
var r4 = "x.x.x.x";
var r4s = "x.x.x.x";
var redisNodes= [{
port: 6379,
host: r1
},{
port: 6379,
host: r2
},{
port: 6379,
host: r3
},{
port:6379,
host:r4
},{
port:6379,
host:r4s,
readOnly: true
},{
port:6379,
host:r1s,
readOnly: true
},{
port:6379,
host:r2s,
readOnly: true
},{
port:6379,
host:r3s,
readOnly: true
}];
var redis = new Redis.Cluster(redisNodes);
redis.defineCommand('calc', {
numberOfKeys: 1,
lua: '.....lua code'
});
redis.calc(key,start,end,screen,function(err,data){
#process result or err
}) |
The var cluster = new Redis.Cluster(nodes, { readOnly: true }); This option means every command sent from the I understand you intention that sending readonly commands to slaves and others to masters. This feature has been discussed in #170 and will be implemented in ioredis v2.0. |
Thx. I got it. |
I noticed lua function not execute on readonly slave node
I used redis.defineCommand to define the lua function
I defined readonly nodes during the connection.
Redis 3.05 cluster
The text was updated successfully, but these errors were encountered: