How does data reading works in redis in terms of master slave server

31 Views Asked by At

Config config = new Config() MasterSlaveServersConfig masterSlaveConfig = config.useMasterSlaveServers() masterSlaveConfig.setMasterAddress("127.0.0.1:6379") masterSlaveConfig.addSlaveAddress("127.0.0.1:6385")

This is how the master and slave nodes are defined in configuration and master slave relation is configured in config file and replicate everything of master to slave node.

When going through the multiple sources it says the read operation is done from the slave node in master slave server configuration but when i tested it in my local and check the hit rate in master and slave nodes the reading is only done from the master node.

Can somebody please tell me how the reading works in master slave server configuration in redis. Or is there any specific way to handle master slave server configuration to read from slave and write in master?

I am using Redisson client to connect with redis.

RMapCache<Object, Object> is used to store the data and read the data.

I have tried to read the data from redis slave node when masterSlave server configuration was configured through redisson client.

But it is always reading from master node.

0

There are 0 best solutions below