Suppose we have 2 Redis Server Backplanes, one as Master and the other as Slave.
Each web application uses SignalR to push content to connected clients as it happens, and to connect them to the backplane that I use in Application_Start
GlobalHost.DependencyResolver.UseRedis(host, port, "", new[] {"signalr.key"});
RouteTable.Routes.MapHubs();
Now, if the Master Redis backplane fails, I would like to promote the Slave Redis server to manage and switch all existing connections from the web servers to the new Master Redis server.
To promote the slave server for the wizard, I use the following code
using (var conn = new RedisConnection(host, port, allowAdmin: true))
{
if (conn.ServerType != ServerType.Master)
{
conn.Open();
var makeMaster = conn.Server.MakeMaster();
var info = conn.Wait(conn.GetInfo());
conn.Wait(makeMaster);
}
}
who seems to be doing this job.
, -, , ?