redisクラスタへの書き込みに問題があります。StackExchange.Redis - redisクラスタへの書き込みはローカルIPアドレスを指します
static readonly IEnumerable<EndPoint> Endpoints = new[]
{
EndPointCollection.TryParse("10.5.2.146:7000"),
EndPointCollection.TryParse("10.5.2.146:7001"),
EndPointCollection.TryParse("10.5.2.146:7002"),
};
public static ConnectionMultiplexer Build()
{
var opt = new ConfigurationOptions { AllowAdmin = true };
foreach (var endpoint in Endpoints)
opt.EndPoints.Add(endpoint);
Redis = ConnectionMultiplexer.Connect(opt);
FlushAllDatabases();
return Redis;
}
とこのようにそれを使用して::
var redis = RedisConfig.Build();
redis.GetDatabase().StringSet("foo", "bar");
redis.GetDatabase().StringGet("foo");
戻りこの例外:両方var endpoints = redis.GetEndPoints();
リターン:
StackExchange.Redis.RedisServerException: 'Endpoint 127.0.0.1:7002 serving hashslot 12182 is not reachable at this point of time. Please check connectTimeout value. If it is low, try increasing it to give the ConnectionMultiplexer a chance to recover from the network disconnect. IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=0,Free=2047,Min=4,Max=2047), Local-CPU: n/a'
私は問題はそれだと思うの構成としてこれを持っ
パブリックIPとクラスタで検出されたエンドポイントを持つエンドポイントを構成します(ローカルIPで検査され、次にプライベートIPを持つノードがハッシュスロットを検索するために使用されます。
私は、クライアントを使用して設定または何かに設定する必要があります何か他のものはありますか?
現在使用されている構成では、各ノードは、それはそれ自身のconfファイルとフォルダ.\700X
だし、ログインします。
redis.conf (for first node)
port 7000
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
logfile 7000.log
protected-mode no
bind 0.0.0.0
nodes.conf
0c213c727e90710bbd94d5094da2c6749872f74f 127.0.0.1:7001 master - 0 1494253090995 2 connected 5461-10922
2e6d24ccec03d1ca674b936eac0e48dc6a97c405 127.0.0.1:7000 myself,master - 0 0 1 connected 0-5460
7467c908c390bb6db202836fdff2966e4f100858 127.0.0.1:7007 slave bdd5c046e2a05b289ef0aba47a9987988defc799 0 1494253090889 8 connected
bbb2d02845e57622b5e95574ab843d9cefd0b28a 127.0.0.1:7006 slave 0c213c727e90710bbd94d5094da2c6749872f74f 0 1494253090890 7 connected
bdd5c046e2a05b289ef0aba47a9987988defc799 127.0.0.1:7002 master - 0 1494253092195 3 connected 10923-16383
c39aa6ff1e9823a169b758fc5aed2f5e811a971a 127.0.0.1:7008 slave bdd5c046e2a05b289ef0aba47a9987988defc799 0 1494253091700 9 connected
673d0af38625ae962f6ed7f527cc5162a08d7f21 127.0.0.1:7003 slave 2e6d24ccec03d1ca674b936eac0e48dc6a97c405 0 1494253091191 4 connected
ed1e5ba7a0a569e2d4b8542bf8a8353d33e81384 127.0.0.1:7004 slave 2e6d24ccec03d1ca674b936eac0e48dc6a97c405 0 1494253090889 5 connected
a4d29951bcf70593d14fbee5438608c88c971922 127.0.0.1:7005 slave 0c213c727e90710bbd94d5094da2c6749872f74f 0 1494253091722 6 connected
vars currentEpoch 9 lastVoteEpoch 0
は、クラスタ – Solo
@MallowFoxでnode.confファイルを表示してください現在redis.confとnodes.conf –