【发布时间】:2019-04-27 22:58:30
【问题描述】:
我正在使用Microsoft.Web.RedisSessionStateProvider 在 Redis 上存储会话信息。
配置文件如下
<!--
<add name="MySessionStateStore"
host = "127.0.0.1" [String]
port = "" [number]
accessKey = "" [String]
ssl = "false" [true|false]
throwOnError = "true" [true|false]
retryTimeoutInMilliseconds = "5000" [number]
databaseId = "0" [number]
applicationName = "" [String]
connectionTimeoutInMilliseconds = "5000" [number]
operationTimeoutInMilliseconds = "1000" [number]
connectionString = "<Valid StackExchange.Redis connection string>" [String]
loggingClassName = "<Assembly qualified class name that contains logging method specified below>" [String]
loggingMethodName = "<Logging method should be defined in loggingClass. It should be public, static, does not take any parameters and should have a return type of System.IO.TextWriter.>" [String]
/>
我能够读取集群上的写入会话信息。
我的集群有多个 IP 3 节点集群,其中一个主节点和另一个子节点。
我无法在 Web 配置文件中指定其他 IP 来处理故障转移情况。
假设我有一个包含 172.29.10.11、172.29.10.12、172.29.10.13 的集群,其中 172.29.10.11 是我的主节点,所以我将此 IP 放在 web.config 文件中
host = "172.29.10.11"
现在万一发生故障,0.12 或 .13 将成为我的主节点。
如何处理故障转移情况。
【问题讨论】:
标签: c# asp.net redis session-state