Open sherwinl1u opened 5 years ago
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 }
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();
///do read wrok }