In our staging environment we have a small server farm of three servers. I will refer to them as MachineA, MachineB, and MachineC. They are setup identically and each one has Redis installed. MachineA is setup as the Redis master with MachineB and MachineC setup as slaves. If I point all servers to the Redis install on MachineA (master) then everything works as expected.
My understanding from looking at the code is that StackExchange.Redis (https://stackexchange.github.io/StackExchange.Redis) is the library that nopCommerce uses to communicate with Redis and it should distinguish between the Master (for writes) and the slaves (for reading). I have tried setting up the Redis slave nodes as read only which causes an immediate write error. When the slave nodes are read/write no errors occur immediately but as the cache gets out of sync (slave nodes do not sync their data up to the master), errors begin to occur.
In the AppSettings.json file I have the following lines
// MachineA - Master node
// Redis support (used by web farms, Azure, etc)
"RedisCachingEnabled": true,
"RedisCachingConnectionString": "127.0.0.1:6379,ssl=False",
"PersistDataProtectionKeysToRedis": false,
...
// MachineB & MachineC - Slave nodes
// Redis support (used by web farms, Azure, etc)
"RedisCachingEnabled": true,
"RedisCachingConnectionString": "127.0.0.1:6379,MachineA:6379,ssl=False",
"PersistDataProtectionKeysToRedis": false,
Does the above configuration look correct?
Thanks for any insights you may be able to offer!
nopCommerce 4.00
Microsoft Windows NT 6.2
ASP.NET v4.0.30319
Redis 4.0.2
StackExchange.Redis.StrongName Version 1.2.6.0