Airflow: TypeError can't pickle memoryview objects

apache-airflow1.9.0 + python3 + rabbitmq + librabbitmq2.0.0

相关配置如下:

broker_url = amqp://cord:123456@localhost:5672//
celery_result_backend = rpc://

结果运行的时候抛出如下异常:

TypeError can't pickle memoryview objects XXXX

原因分析:

airflow 1.9.0使用的是celery4.x, 而celery 4.x使用json序列化,而不是用pickle进行序列化。

因此需要将librabbitmq改为pyamqp

broker_url

Default: "amqp://"

Default broker URL. This must be a URL in the form of:

transport://userid:password@hostname:port/virtual_host

Only the scheme part (transport://) is required, the rest is optional, and defaults to the specific transports default values.

The transport part is the broker implementation to use, and the default is amqp, (useslibrabbitmq if installed or falls back to pyamqp). There are also other choices available, including; redis://, sqs://, and qpid://.

http://docs.celeryproject.org/en/latest/userguide/configuration.html#conf-database-result-backend

因此将broker_url配置协议修改为pyamqp即可:

broker_url = pyamqp://cord:123456@localhost:5672//

参考链接:

https://github.com/celery/celery/issues/4693

转载于:https://www.cnblogs.com/cord/p/9263491.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值