-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
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
how can I add multiple redis url and redbeat_broker_url rabbitmq #156
Comments
wow no upd over here. What a nice project... |
I know this is old but hope it would help the key is to set redbeat_redis_url to sentinel dsn but redbeat/scheduler.py:124 checks for elif conf.redis_url.startswith('redis-sentinel') and 'sentinels' in redis_options:
... so you have to change your sentinel dsn (for redbeat only) to please note that it is perfectly valid of anyways, if your sentinel requires auth - provide my # at this point we would just dump it from celery_settings (pydantic model)
locals().update(celery_settings.model_dump())
# now we can override some
if redis_settings.redis_mode == "sentinel":
broker_url = redis_settings.sentinel_dsn
result_backend_transport_options = REDIS_PARAMS
broker_transport_options = REDIS_PARAMS
redbeat_redis_url = redis_settings.sentinel_dsn.replace("sentinel://", "redis-sentinel://")
redbeat_redis_options = {
"sentinels": redis_settings.sentinels,
"sentinel_kwargs": {},
"password": redis_settings.password,
"db": redis_settings.db,
"service_name": redis_settings.master_name,
"retry_on_timeout": True,
"socket_timeout": 1,
"socket_connect_timeout": 1,
"socket_keepalive": True,
"socket_keepalive_options": {socket.TCP_KEEPCNT: 5, socket.TCP_KEEPIDLE: 60, socket.TCP_KEEPINTVL: 10},
"retry_period": 10,
} debug output would look like that
|
Hi, I am trying to add multiple redis (for high availability) url to redbeat_redis_url and I also wants to add broker_url for rabbitmq.
I am trying to use rabbitmq as a message broker. and redis as a beat data store. because of clustering.
app.conf.update(
broker_url = 'amqp://localhost:5672/',
redbeat_redis_url = 'redis://master1:6379/1',
redbeat_redis_options = {
'sentinels': [('slave2:6379'),
('slave3.18:6379')],
'socket_timeout': 0.1,
'retry_period': 0.1
}
)
After I close master, beat stop. Does go to red_beat_redis_options
and also 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,
}
The text was updated successfully, but these errors were encountered: