gpt4 book ai didi

python - 将 Flower 部署到 Heroku

转载 作者:行者123 更新时间:2023-11-28 16:37:18 38 4
gpt4 key购买 nike

我正在按照 https://github.com/jorilallo/celery-flower-heroku 上的说明进行操作将 Flower celery 监控应用程序部署到 Heroku。

配置和部署我的应用后,我在 heroku 日志中看到以下内容:

Traceback (most recent call last):
File "/app/.heroku/python/bin/flower", line 9, in <module>
load_entry_point('flower==0.7.0', 'console_scripts', 'flower')()
File "/app/.heroku/python/lib/python2.7/site-packages/flower/__main__.py", line 11, in main
flower.execute_from_commandline()
File "/app/.heroku/python/lib/python2.7/site-packages/celery/bin/base.py", line 306, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/app/.heroku/python/lib/python2.7/site-packages/flower/command.py", line 99, in handle_argv
return self.run_from_argv(prog_name, argv)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/command.py", line 75, in run_from_argv
**app_settings)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/app.py", line 40, in __init__
max_tasks_in_memory=max_tasks)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/events.py", line 60, in __init__
state = shelve.open(self._db)
File "/app/.heroku/python/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/app/.heroku/python/lib/python2.7/shelve.py", line 223, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "/app/.heroku/python/lib/python2.7/anydbm.py", line 85, in open
return mod.open(file, flag, mode)
File "/app/.heroku/python/lib/python2.7/dumbdbm.py", line 250, in open
return _Database(file, mode)
File "/app/.heroku/python/lib/python2.7/dumbdbm.py", line 71, in __init__
f = _open(self._datfile, 'w')
IOError: [Errno 2] No such file or directory: 'postgres://USERNAME:PASSWORD@ec2-HOST.compute-1.amazonaws.com:5432/DBNAME.dat'

注意到那里的 .dat 附录了吗?不知道它来自哪里,它不存在于我的 DATABASE_URL 环境变量中。

此外,上面的错误是花0.7。我还尝试安装 0.6,我确实取得了进一步的进展(即正确识别了数据库并建立了连接),但是一旦 flower 启动,我就会收到以下警告:

2014-06-19T15:14:02.464424+00:00 app[web.1]: [E 140619 15:14:02 state:138] Failed to inspect workers: '[Errno 104] Connection reset by peer', trying again in 128 seconds
2014-06-19T15:14:02.464844+00:00 app[web.1]: [E 140619 15:14:02 events:103] Failed to capture events: '[Errno 104] Connection reset by peer', trying again in 128 seconds.

在我的浏览器中加载 flower 确实显示了一些选项卡,但没有数据。

我该如何解决这些问题?

最佳答案

Flower 不支持数据库持久化。它使用 shelve 将状态保存到文件中模块。

关于python - 将 Flower 部署到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24310489/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com