i m working with Redis distributed cache with failover pattern merged with hashing data distribution. My configuration is :
Sentinel1 Sentinel4
Master1 Master2
Sentinel2 Sentinel5
Slave1 Slave2
Sentinel3 Sentinel6
In my code i need to access master cache using sentinel.
Which one have i to point?
I suppose i have to register all the sentinel enpoints inside the configuration of the ConnectionMultiplexer.
I m able to connect my client to sentinel using this code:
var options = new ConfigurationOptions()
{
CommandMap = CommandMap.Sentinel,
EndPoints = { { IP, Port } },
AllowAdmin = true,
TieBreaker = "",
ServiceName = ServiceName,
SyncTimeout = 5000,
AbortOnConnectFail = true,
Ssl = false
};
var connection = ConnectionMultiplexer.Connect(options, Console.Out);
return connection;
Once got the connection i need to access the cache database using the standard redis methods like SetString and getString... so
db = conn.getDatabase();
db.getString(key);
db.setString(key, value);
at this point i get an error stating "This operation has been disabled in the command-map and cannot be used: SETEX" or GET.
I suppose there should be a way to ask the sentinel the connection to the current master, but i m not finding many useful code example around. Can anyone help me please?