Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

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

@sherwinl1u

Description

@sherwinl1u

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions