我的服务如下:
[Service]
User=vagrant
Group=vagrant
WorkingDirectory=/home/vagrant/
ExecStart=/usr/bin/celery -A tasks /usr/bin/flower --port=5000 --basic_auth=sun:flower --persistent=true --/var/log/supervisord.log
Restart=on-failure
Type=simple
在创建 REDIS 主从复制并将芹菜和花指向主
...芹菜.ini主管
[program:SPSimpleTasks]
directory = /home/vagrant/
command = celery -A tasks worker --loglevel=DEBUG -n SimpleTasks
user=vagrant
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisord.log
stderr_logfile=/var/log/supervisord.log
celery_app.py
from celery import Celery
app = Celery('tasks', backend='redis://:<PASSWORD>@192.168.100.20:6379/0')
#app.config_from_object('celeryconfig')
app.conf.update(
enable_utc = True,
broker_url = 'redis://:<PASSWORD>@192.168.100.20:6379/0',
result_backend = 'redis://:<PASSWORD>@192.168.100.20:6379/1',
result_persistent = True,
task_serializer = 'json',
result_serializer = 'json',
accept_content = ['json']
)
再次,工人工作正常,花朵显示任务结果。但是一旦我使用
须藤服务花重启
花加载作为其全新的安装,没有任何数据...
我在代理/后端 url 上做错了什么吗?
嗯,这是对 Flower 中配置的额外更改,我稍微改变了方法!
所需的配置属性为 db
我将服务更新为
/etc/systemd/system/flower.service
[Unit]
Description=Flower Celery Service
[Service]
User=vagrant
Group=vagrant
WorkingDirectory=/home/vagrant/
ExecStart=/usr/bin/flower --/var/log/supervisord.log
Restart=on-failure
Type=simple
[Install]
WantedBy=multi-user.target
/home/vagrant/flowerconfig.py
port = 5000
broker = 'redis://:<password>@192.168.100.20:6379/0'
broker_api = 'redis://:<password>@192.168.100.20:6379/0'
basic_auth = ['sun:flower']
persistent = True
db = '/home/vagrant/flower.db'
提供数据库属性后,一切都很好。除了一个问题..花卉仪表板未显示数据,但任务页面在刷新之前正在加载任务列表!
向 http://flower.readthedocs.io/en/latest/config.html#db 学习
启用持久模式时要使用的数据库文件(默认情况下, 分贝=花(
我已经提交了与花中的问题/观察相同的内容 - https://github.com/mher/flower/issues/787
希望这有助于其他面临类似问题的人!!