使用最新版本的 apache 气流。从 LocalExecutor 开始,在该模式下一切正常,除了一些交互,Web UI 状态需要 CeleryExecutor 才能使用它们。使用 Redis 安装和配置 Celery 执行器,将 Redis 配置为代理 URL 和结果后端。
一开始它似乎可以工作,直到安排了一个任务,此时它给出了以下错误:
File "/bin/airflow", line 28, in <module>
args.func(args)
File "/usr/lib/python2.7/site-packages/airflow/bin/cli.py", line 882, in scheduler
job.run()
File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 201, in run
self._execute()
File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 1311, in _execute
self._execute_helper(processor_manager)
File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 1444, in _execute_helper
self.executor.heartbeat()
File "/usr/lib/python2.7/site-packages/airflow/executors/base_executor.py", line 132, in heartbeat
self.sync()
File "/usr/lib/python2.7/site-packages/airflow/executors/celery_executor.py", line 91, in sync
state = async.state
File "/usr/lib/python2.7/site-packages/celery/result.py", line 436, in state
return self._get_task_meta()['status']
File "/usr/lib/python2.7/site-packages/celery/result.py", line 375, in _get_task_meta
return self._maybe_set_cache(self.backend.get_task_meta(self.id))
File "/usr/lib/python2.7/site-packages/celery/backends/base.py", line 352, in get_task_meta
meta = self._get_task_meta_for(task_id)
File "/usr/lib/python2.7/site-packages/celery/backends/base.py", line 668, in _get_task_meta_for
return self.decode_result(meta)
File "/usr/lib/python2.7/site-packages/celery/backends/base.py", line 271, in decode_result
return self.meta_from_decoded(self.decode(payload))
File "/usr/lib/python2.7/site-packages/celery/backends/base.py", line 278, in decode
accept=self.accept)
File "/usr/lib/python2.7/site-packages/kombu/serialization.py", line 263, in loads
return decode(data)
File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/site-packages/kombu/serialization.py", line 54, in _reraise_errors
reraise(wrapper, wrapper(exc), sys.exc_info()[2])
File "/usr/lib/python2.7/site-packages/kombu/serialization.py", line 50, in _reraise_errors
yield
File "/usr/lib/python2.7/site-packages/kombu/serialization.py", line 263, in loads
return decode(data)
File "/usr/lib/python2.7/site-packages/kombu/serialization.py", line 59, in pickle_loads
return load(BytesIO(s))
kombu.exceptions.DecodeError: invalid load key, '{'.
似乎是泡菜序列化错误,但我不确定如何追踪原因。有什么建议么?
这个问题一直影响我使用 subdag 功能的工作流程,也许问题与此有关。
注意:我也使用 rabbitMQ 进行了测试,那里有不同的问题;客户端显示“对等方重置连接”并崩溃。RabbitMQ 日志显示“客户端意外关闭 TCP 连接”。