Skip to main content

RedisSentinel

Assembly: ServiceStack.Redis.dll
View Source
Declaration
public class RedisSentinel : IRedisSentinel, IDisposable

Properties

MasterName

View Source
Declaration
public string MasterName { get; }

SentinelHosts

View Source
Declaration
public List<string> SentinelHosts { get; }

RedisManagerFactory

Change to use a different IRedisClientsManager

View Source
Declaration
public Func<string[], string[], IRedisClientsManager> RedisManagerFactory { get; set; }

HostFilter

Configure the Redis Connection String to use for a Redis Instance Host

View Source
Declaration
public Func<string, string> HostFilter { get; set; }

SentinelHostFilter

Configure the Redis Connection String to use for a Redis Sentinel Host

View Source
Declaration
public Func<string, string> SentinelHostFilter { get; set; }

RedisManager

The configured Redis Client Manager this Sentinel managers

View Source
Declaration
public IRedisClientsManager RedisManager { get; set; }

OnFailover

Fired when Sentinel fails over the Redis Client Manager to a new master

View Source
Declaration
public Action<IRedisClientsManager> OnFailover { get; set; }

OnWorkerError

Fired when the Redis Sentinel Worker connection fails

View Source
Declaration
public Action<Exception> OnWorkerError { get; set; }

OnSentinelMessageReceived

Fired when the Sentinel worker receives a message from the Sentinel Subscription

View Source
Declaration
public Action<string, string> OnSentinelMessageReceived { get; set; }

IpAddressMap

Map the internal IP's returned by Sentinels to its external IP

View Source
Declaration
public Dictionary<string, string> IpAddressMap { get; set; }

ScanForOtherSentinels

Whether to routinely scan for other sentinel hosts (default true)

View Source
Declaration
public bool ScanForOtherSentinels { get; set; }

RefreshSentinelHostsAfter

What interval to scan for other sentinel hosts (default 10 mins)

View Source
Declaration
public TimeSpan RefreshSentinelHostsAfter { get; set; }

WaitBetweenFailedHosts

How long to wait after failing before connecting to next redis instance (default 250ms)

View Source
Declaration
public TimeSpan WaitBetweenFailedHosts { get; set; }

MaxWaitBetweenFailedHosts

How long to retry connecting to hosts before throwing (default 60 secs)

View Source
Declaration
public TimeSpan MaxWaitBetweenFailedHosts { get; set; }

WaitBeforeForcingMasterFailover

How long to wait after consecutive failed connection attempts to master before forcing a Sentinel to failover the current master (default 60 secs)

View Source
Declaration
public TimeSpan WaitBeforeForcingMasterFailover { get; set; }

SentinelWorkerConnectTimeoutMs

The Max Connection time for Sentinel Worker (default 250ms)

View Source
Declaration
public int SentinelWorkerConnectTimeoutMs { get; set; }

SentinelWorkerReceiveTimeoutMs

The Max TCP Socket Receive time for Sentinel Worker (default 250ms)

View Source
Declaration
public int SentinelWorkerReceiveTimeoutMs { get; set; }

SentinelWorkerSendTimeoutMs

The Max TCP Socket Send time for Sentinel Worker (default 250ms)

View Source
Declaration
public int SentinelWorkerSendTimeoutMs { get; set; }

ResetWhenSubjectivelyDown

Reset client connections when Sentinel reports redis instance is subjectively down (default true)

View Source
Declaration
public bool ResetWhenSubjectivelyDown { get; set; }

ResetWhenObjectivelyDown

Reset client connections when Sentinel reports redis instance is objectively down (default true)

View Source
Declaration
public bool ResetWhenObjectivelyDown { get; set; }

Fields

Log

View Source
Declaration
protected static readonly ILog Log

DefaultMasterName

View Source
Declaration
public static string DefaultMasterName

DefaultAddress

View Source
Declaration
public static string DefaultAddress

Methods

Start()

Initialize Sentinel Subscription and Configure Redis ClientsManager

View Source
Declaration
public IRedisClientsManager Start()
Returns

ServiceStack.Redis.IRedisClientsManager

GetActiveSentinelHosts(IEnumerable<String>)

View Source
Declaration
public List<string> GetActiveSentinelHosts(IEnumerable<string> sentinelHosts)
Returns

System.Collections.Generic.List<System.String>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.String>sentinelHosts

RefreshActiveSentinels()

View Source
Declaration
public void RefreshActiveSentinels()

ResetClients()

View Source
Declaration
public SentinelInfo ResetClients()
Returns

SentinelInfo

GetRedisManager()

View Source
Declaration
public IRedisClientsManager GetRedisManager()
Returns

ServiceStack.Redis.IRedisClientsManager

GetMaster()

View Source
Declaration
public RedisEndpoint GetMaster()
Returns

ServiceStack.Redis.RedisEndpoint

GetSlaves()

View Source
Declaration
public List<RedisEndpoint> GetSlaves()
Returns

System.Collections.Generic.List<ServiceStack.Redis.RedisEndpoint>

ForceMasterFailover()

View Source
Declaration
public void ForceMasterFailover()

GetSentinelInfo()

View Source
Declaration
public SentinelInfo GetSentinelInfo()
Returns

SentinelInfo

Dispose()

View Source
Declaration
public void Dispose()

Implements