title: Trying to use Redis Sentinel with Net Core 2.1
body: <p>Well, I'm using <code>Net Core 2.1</code> with lib <code>Microsoft.Extensions.Caching.Redis ver 2.1.2</code>, and when I'm working with only one Redis node, everything works fine.</p>
  <p>Working with single node:</p>
  <pre><code>services.AddDistributedRedisCache(ops =&gt;
              {
                  ops.Configuration = &quot;localhost:6379&quot;;
                  ops.InstanceName = &quot;master&quot;;
              });
  </code></pre>
  <p>But now, I'm trying to use Redis with Sentinel, so I changed my configuration to (following this guide <a href="https://stackexchange.github.io/StackExchange.Redis/Configuration.html" rel="nofollow noreferrer">https://stackexchange.github.io/StackExchange.Redis/Configuration.html</a>):</p>
  <pre><code> services.AddDistributedRedisCache(ops =&gt;
              {
                  ops.Configuration = &quot;localhost,serviceName:mymaster&quot;;
                  ops.InstanceName = &quot;master&quot;;
              });
  </code></pre>
  <p>So, I have a docker-compose.yml to startup redis nodes with sentinel:</p>
  <pre><code>version: '2'
  services:
    redis-master:
      image: bitnami/redis:5.0
      environment:
        ALLOW_EMPTY_PASSWORD: 'yes'
        REDIS_REPLICATION_MODE: 'master'
      ports:
        - '6379:6379'
    redis-slave1:
      image: bitnami/redis:5.0
      environment:
        ALLOW_EMPTY_PASSWORD: 'yes'
        REDIS_REPLICATION_MODE: 'slave'
        REDIS_MASTER_HOST: redis-master
      depends_on:
        - redis-master
      ports:
        - '6380:6380'
    redis-slave2:
      image: bitnami/redis:5.0
      environment:
        ALLOW_EMPTY_PASSWORD: 'yes'
        REDIS_REPLICATION_MODE: 'slave'
        REDIS_MASTER_HOST: redis-master
      depends_on:
        - redis-master
      ports:
        - '6381:6381'
    redis-sentinel:
      image: bitnami/redis-sentinel:5.0
      environment:
        REDIS_MASTER_HOST: redis-master
        REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS: 10000
      ports:
        - '26379:26379'
  </code></pre>
  <p>When I startup my application everything works fine, so I shutdown the master node to test sentinel and got the following error in Asp Net Core:</p>
  <pre><code>RedisConnectionException: SocketClosed on localhost:6379/Subscription, origin: ProcessReadBytes, input-buffer: 0, outstanding: 0, last-read: 14s ago, last-write: 14s ago, unanswered-write: 1998113s ago, keep-alive: 60s, pending: 0, state: ConnectedEstablished, in: 0, ar: 0, last-heartbeat: 0s ago, last-mbeat: 0s ago, global: 0s ago
  Unknown location
  
  RedisConnectionException: No connection is available to service this operation: EVAL; SocketClosed on localhost:6379/Subscription, origin: ProcessReadBytes, input-buffer: 0, outstanding: 0, last-read: 14s ago, last-write: 14s ago, unanswered-write: 1998113s ago, keep-alive: 60s, pending: 0, state: ConnectedEstablished, in: 0, ar: 0, last-heartbeat: 0s ago, last-mbeat: 0s ago, global: 0s ago
  StackExchange.Redis.ConnectionMultiplexer.ThrowFailed&lt;T&gt;(TaskCompletionSource&lt;T&gt; source, Exception unthrownException) in ConnectionMultiplexer.cs, line 2000
  </code></pre>
  <p>Well, if I start master node again, everything works, but this is not expected behavior. I expected that after shutdown master node, sentinel promote a slave to master, and I can continue using redis without errors.</p>
  <p>Am I missing somehting ?</p>