Skip to content
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

After calling redisClusterSetOptionParseSlaves, hiredis-vip still does not read the slave, only reads data from the master node. #121

Open
sherwinl1u opened this issue Jul 15, 2019 · 0 comments

Comments

@sherwinl1u
Copy link

sherwinl1u commented Jul 15, 2019

RedisClusterSetOptionParseSlaves was called before the connection, but the actual test still does not connect to the slave node, what additional work is needed.

The connection code is roughly as follows:
int main(){
cc_ = redisClusterContextInit();

redisClusterSetOptionAddNodes(cc_, hostlist_.c_str());
redisClusterSetOptionRouteUseSlots(cc_);
redisClusterSetOptionParseSlaves(cc_);

redisClusterConnect2(cc_);
if (cc_ == NULL || cc_->err)
{
    printf("Connect redis cluster fail, addr[%s], err[%s]",
                                hostlist_.c_str(),  cc_ == NULL ? "NULL" : cc_->errstr);
    return -1;
}

///do read wrok
}

@sherwinl1u sherwinl1u changed the title 调用redisClusterSetOptionParseSlaves之后, hiredis-vip仍然不读slave, 只从master节点读取数据 After calling redisClusterSetOptionParseSlaves, hiredis-vip still does not read the slave, only reads data from the master node. Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant