总结:搭建环境之类的操作一定按照官方manual来,不要主观臆测,一知半解的情况下就去做,可能会踩到很多坑。不要嫌看英文资料麻烦,英文资料实际上可能才是最正确的资料,很多中文资料都是二手的,有可能会把你带坑里去。
续:
搭好rabbitmq之后,用python的celery跑后台任务,rabbitmq作broker,redis作backend,结果任务执行完成后总是获取不到结果,result.ready()总是返回False。后经查阅资料后解决,是windows版的celery的问题,windows下使用celery命令跑worker时需要加上--pool=solo或者-P threads,完整命令为:
celery -A tasks worker --loglevel=info -P threads
参考资料如下:
https://www.v2ex.com/t/177589
https://github.com/celery/celery/issues/2146
https://github.com/celery/celery/issues/2428
http://stackoverflow.com/questions/25495613/celery-getting-started-not-able-to-retrieve-results-always-pending?rq=1