解决redis连接错误:MISCONF Redis is configured to save RDB snapshots
启动celery分布式的worker(同一个laufing.py在多个电脑上启动worker进程)进程时,连接 redis报错:
MISCONF Redis is configured to save RDB snapshots(快照), but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
因为强制把redis快照关闭了导致不能持久化的问题,通过修改配置项stop-writes-on-bgsave-error值,设置为no即可避免这种问题。
后台启动celery worker进程
ubuntu 环境已测试:
# 需要root权限
celery multi start -A laufing worker1 -l debug -f /var/log/celery/celery.log
worker1是进程的名字,可以查看log文件,确认执行任务。