We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating 2nd connection to to Redis sentinel deployment using the same ConfigurationOptions instance fails with exception.
Creating multiple connections with the same configuration instance should succeed.
Failure with exception. It looks like ConfigurationOptions instance passed to ConnectionMultiplexer.Connect is getting modified.
ConfigurationOptions
ConnectionMultiplexer.Connect
NOTE: Cloning ConfigurationOptions before connect also does not work.
Redis sentinel deployment with 2 slaves : Docker compose is attached. OS : Ubuntu 20.04 LTS .NET Core Version : 3.1.25 Redis NuGet Package Version: StackExchange.Redis 2.5.61
Start the sentinel cluster with default sentinel port
docker-compose up --scale redis-sentinel=3 -d
Run the below sample application. Demo sample program
using System; using System.IO; using System.Net; using System.Net.NetworkInformation; using System.Runtime.InteropServices; using StackExchange.Redis; namespace netcore31 { class Program { static void Main(string[] args) { ConfigurationOptions configurationOptions = ConfigurationOptions.Parse("localhost"); configurationOptions.ServiceName = "mymaster"; configurationOptions.Password = "str0ng_passw0rd"; // 1st Connection using var firstConnection = ConnectionMultiplexer.Connect(configurationOptions); System.Console.WriteLine(firstConnection.GetStatus()); IDatabase database = firstConnection.GetDatabase(); database.StringSet("SomeKey","SomeValue"); System.Console.WriteLine(database.StringGet("SomeKey")); // Eastblishing second connection 2nd throws exception using var secondConnection = ConnectionMultiplexer.Connect(configurationOptions); System.Console.WriteLine(secondConnection.GetStatus()); } } }
ConfigurationOptions object passed to ConnectionMultiplexer.Connect is getting changed hence
https://hub.docker.com/r/bitnami/redis-sentinel/
version: '2' networks: app-tier: driver: bridge services: redis: image: 'bitnami/redis:latest' environment: - REDIS_REPLICATION_MODE=master - REDIS_PASSWORD=str0ng_passw0rd networks: - app-tier ports: - '6379' redis-slave: image: 'bitnami/redis:latest' environment: - REDIS_REPLICATION_MODE=slave - REDIS_MASTER_HOST=redis - REDIS_MASTER_PASSWORD=str0ng_passw0rd - REDIS_PASSWORD=str0ng_passw0rd ports: - '6379' depends_on: - redis networks: - app-tier redis-sentinel: image: 'bitnami/redis-sentinel:latest' environment: - REDIS_MASTER_PASSWORD=str0ng_passw0rd depends_on: - redis - redis-slave ports: - '26379-26381:26379' networks: - app-tier
The text was updated successfully, but these errors were encountered:
Alrighty 2 different issues here made this tricky to reason about but figured out what's happening. Fixes coming in #2242 :)
Sorry, something went wrong.
846e096
Successfully merging a pull request may close this issue.
Creating 2nd connection to to Redis sentinel deployment using the same ConfigurationOptions instance fails with exception.
What is expected
Creating multiple connections with the same configuration instance should succeed.
What is observed
Failure with exception.
It looks like
ConfigurationOptions
instance passed toConnectionMultiplexer.Connect
is getting modified.Setup
Redis sentinel deployment with 2 slaves : Docker compose is attached.
OS : Ubuntu 20.04 LTS
.NET Core Version : 3.1.25
Redis NuGet Package Version: StackExchange.Redis 2.5.61
Start the sentinel cluster with default sentinel port
Run the below sample application.
Demo sample program
ConfigurationOptions object passed to ConnectionMultiplexer.Connect is getting changed hence
https://hub.docker.com/r/bitnami/redis-sentinel/
The text was updated successfully, but these errors were encountered: