0

I am getting this error when I run celery beat -S redbeat.RedBeatScheduler.

beat raised exception : ConnectionError('Error -2 connecting to redis-sentinel:26379. Name or service not known.',)

How can I create a service_name and password in redis-sentinel I am not trying to use redis as a message broker. I am using celery-redbeat to store celerybeat data in redis-sentinel cluster from this page.https://pypi.org/project/celery-redbeat/

and

from this configuration

redbeat_redis_url = 'redis-sentinel://redis-sentinel:26379/0'
redbeat_redis_options = {
    'sentinels': [('192.168.1.1', 26379),
                  ('192.168.1.2', 26379),
                  ('192.168.1.3', 26379)],
    'socket_timeout': 0.1,
}

I add 192.168.1.1:26379 instead of redis-sentinel:/26379 but when master node down in redis-sentinel cluster beat is down too.

redbeat_redis_url = 'redis-sentinel://192.168.1.1:26379/0'
redbeat_redis_options = {
    'sentinels': [('192.168.1.2', 26379),
                  ('192.168.1.3', 26379)],
    'socket_timeout': 0.1,
}

newUser
  • 386
  • 5
  • 17

1 Answers1

0

Unless you have redis-sentinel in your /etc/hosts file it will not be able to resolve it to a correct IP address. You may try to replace redis-sentinel with an IP address of your Redis server. Furthermore, it does not look like a proper Redis Sentinel configuration. Redis Configuration section explains how to connect to Redis Sentinel, please read it.

DejanLekic
  • 18,787
  • 4
  • 46
  • 77
  • I am trying to use celery-redbeat from this page https://pypi.org/project/celery-redbeat/ and I am trying to use this configuration – newUser Apr 09 '20 at 10:48
  • ```redbeat_redis_url= 'redis-sentinel://redis-sentinel:26379/0' redbeat_redis_options = { 'sentinels': [('192.168.1.1', 26379), ('192.168.1.2', 26379), ('192.168.1.3', 26379)], 'password': '123', 'service_name': 'master', 'socket_timeout': 0.1, } ``` – newUser Apr 09 '20 at 10:48
  • please read this I am not using redis as a message broker. I am trying to store beat file in redis-sentinel cluster. – newUser Apr 09 '20 at 10:49