Redis Settings

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
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
5 years ago
pdavis wrote:
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



No, your just overwriting the previous values defining them more than once (or it always uses the first set).  Servers are put in the connection string, master first then slaves.
5 years ago
The appsettings.json excerpts are from seperate files. Sorry the elipses didn't make that clear. So the first set of settings is from the appsettings on MachineA. The second set of listings is in the settings file on MachineB and MachineC.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.