question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR [RedisModule] default: All sentinels are unreachable. Retrying from scratch after 160ms.

See original GitHub issue

Trying to set up Sentinel, but I am having some issues.

My docker-compose.yaml:

  redis-sentinel:
    image: bitnami/redis-sentinel:latest
    restart: always
    ports:
      - 26379:26379
    networks:
      - nestjs-network
    environment:
      - REDIS_MASTER_HOST=redis
  redis:
    image: 'bitnami/redis:latest'
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    networks:
      - nestjs-network
    ports:
      - 6379:6379

Sentinel seems to be up and running:

redis-sentinel 14:59:36.90
redis-sentinel 14:59:36.94 Welcome to the Bitnami redis-sentinel container
redis-sentinel 14:59:36.98 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 14:59:37.02 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 14:59:37.06
redis-sentinel 14:59:37.09 INFO  ==> ** Starting Redis sentinel setup **
redis-sentinel 14:59:37.41 INFO  ==> Initializing Redis Sentinel...
redis-sentinel 14:59:37.48 INFO  ==> Configuring Redis Sentinel...
redis-sentinel 14:59:38.35 INFO  ==> ** Redis sentinel setup finished! **

redis-sentinel 14:59:38.50 INFO  ==> ** Starting Redis Sentinel **
1:X 10 Apr 2022 14:59:38.607 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:X 10 Apr 2022 14:59:38.608 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:X 10 Apr 2022 14:59:38.608 # Configuration loaded
1:X 10 Apr 2022 14:59:38.611 * monotonic clock: POSIX clock_gettime
1:X 10 Apr 2022 14:59:38.621 * Running mode=sentinel, port=26379.
1:X 10 Apr 2022 14:59:38.650 # Sentinel ID is d1cb69092f21a9c96e793f94cc937c2828b8ab04
1:X 10 Apr 2022 14:59:38.651 # +monitor master mymaster 172.23.0.4 6379 quorum 2

My configuration:

return {
	readyLog: true,
	commonOptions: {
		name: 'mymaster',
		sentinels: [
			{
				host: "localhost", // I am running npm locally (not in docker)
				port: 26379,
			},
		],
	},
	config: [
		{
			// get master node from the sentinel group
			role: 'master',
		},
		{
			// get a random slave node from the sentinel group
			role: 'slave',
		},
	],
}

But I am getting error:

[Nest] 7506  - 04/10/2022, 5:08:21 PM   ERROR [RedisModule] default: All sentinels are unreachable. Retrying from scratch after 130ms.
Error: All sentinels are unreachable. Retrying from scratch after 130ms.

What am I missing here?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
liaoliaotscommented, Apr 10, 2022

your compose config does not specify slave nodes.

try this:

{
    readyLog: true,
    commonOptions: {
        name: 'mymaster',
        sentinels: [
            {
                host: 'localhost', // I am running npm locally (not in docker)
                port: 26379
            }
        ]
    },
    config: [
        {
            // get master node from the sentinel group
            role: 'master'
        }
    ]
}

some docs:

0reactions
simplenotezycommented, Nov 22, 2022

Yes, I can share with you my config when I’m back at the computer

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERR unknown command `sentinel`, with args beginning with ...
I'm trying to establish a connectivity but getting error - Debug log: ... ERROR Error: All sentinels are unreachable. Retrying from scratch after...
Read more >
redis: all sentinels specified in configuration are unreachable
First I thought this is fine - connection is being cancelled/closed and context is cancelled. But looking at the volume of the errors,...
Read more >
Error when trying to connect to sentinel with password using ...
I have get error when try add password to connection options [ioredis] Unhandled error event: Error: All sentinels are unreachable. Retrying ...
Read more >
[ioredis] Unhandled error event: Error: All sentinels are ...
[ioredis] Unhandled error event: Error: All sentinels are unreachable. Retrying from scratch after 10ms Last error: Connection is closed.
Read more >
ioredis - npm
By default, all pending commands will be flushed with an error every 20 retry attempts. That makes sure commands won't wait forever when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found