Data search
Https://www.cnblogs.com/tdws/p/5836122.html
Https://www.cnblogs.com/lori/p/5794454.html
private static readonly connectionmultiplexer _sentinel;
static Isubscriber Sub;
Static Isubscriber sentinelsub;
Configurationoptions sentineloption = new Configurationoptions ();
configurationoptions option = new Configurationoptions ();
Option. Endpoints.add ("10.55.8.110", 6379);
Option. Endpoints.add ("10.55.8.111", 6379);
Option. Password = "abc12345!";
Connectionmultiplexer _redis = connectionmultiplexer.connect (option);
Idatabase _db = _redis. Getdatabase ();
Sentineloption. tiebreaker = "";
Sentineloption. Endpoints.add ("10.55.8.110", 26379);
Sentineloption. Endpoints.add ("10.55.8.111", 26379);
Sentineloption. Allowadmin = true;
Sentineloption.commandmap = Commandmap.sentinel;
Connectionmultiplexer _sentinel = Connectionmultiplexer.connect (sentineloption);
Option.commandmap = Commandmap.sentinel;
Sentinelsub = _sentinel. Getsubscriber ();
Subsentinel ()
public void Subsentinel ()
{
Sentinelsub. Subscribe ("+switch-master", (channel, message) = =
{
Lblshow.text = (string) message;
Console.WriteLine ((string) message);
});
}
Redis Deployment Master-Slave Sentinel C # used to automate the acquisition of Redis cache instances 2