redisの様々なエラーの可能な解決策

2142 ワード

1. Timeout performing EVAL

これはライブラリからライブラリにつながっているかもしれませんが、直接ライブラリに変更すれば大丈夫です.
2.
  ConnectTimeout

普通はたまにタイムアウトしたり、よくタイムアウトしたりしますが、この場合、いろいろな答えを探して、最後にstackoverflowで大物が解決方法をくれたのを見て、やってみました.
対応アドレス:https://stackoverflow.com/questions/23160094/stackexchange-redis-connectionmultiplexer-connect-intermittently-works
内容は次のとおりです.
I could solve the above by doing this :
The error you are getting is usually a sign that you have not set abortConnect=false in your connection string. The default value for abortConnect is true, which makes it so that StackExchange.Redis won't reconnect to the server automatically under some conditions. We strongly recommend that you set abortConnect=false in your connection string so that SE.Redis will auto-reconnect in the background if a network blip occurs.
Source : https://stackoverflow.com/a/30918632/2236811
So my init() looked like this
 ConfigurationOptions co = new ConfigurationOptions()
        {
            SyncTimeout = 500000,
            EndPoints =
            {
                {url,portNumber }
            },
            AbortOnConnectFail = false // this prevents that error
        };

        seClient = ConnectionMultiplexer.Connect(co);

 
thanks
以上です.英語が読めないなら大丈夫です.コードをコピーして使えばいいです.
例えば私はこう書いています.
192.168.0.1:6379,abortConnect=false,syncTimeout=500000

これでいいです.
 
 
以上のredis操作はすべて:StackExchange.Redisが行いました.
転載先:https://www.cnblogs.com/qiywtc/p/9318158.html