微服务,比如用screen隔离开,然后每个service使用不同端口通信
基础在前:
微服务下用户微服务和celery微服务的交互:flask app.py 和celery task.py在同一目录:先启动celery微服务:screen -S celery_servicecd app:celery -A app.task.celery worker -l info再启动flask:screen -r user_postuwsgi --http :5002 -w app.maincd app:https://api5.xxx.com/user/posts/testingpost application/json{ "url": "http://s3.xxx.com/ba7571a95d64eaa69a49912f26816e2f.jpg"}{ "code": 0, "data": { "task_id": "2ca85c18-9710-4735-aadc-26c5d7482828" }, "message": "Success"}https://api5.xxx.com/user/posts/testing/2ca85c18-9710-4735-aadc-26c5d7482828get{ "code": 0, "data": { "id": "2ca85c18-9710-4735-aadc-26c5d7482828", "ready": true, "result": ["http://s3.xxx.com/ba7571a95d64eaa69a49912f26816e2f.jpg", 60, "helloworld" ], "state": "SUCCESS", "status": "SUCCESS" }, "message": "Success"}
文件目录: