在beantalk上部署flask-socketio [英] Deploy flask-socketio on beanstalk

查看:84
本文介绍了在beantalk上部署flask-socketio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法完全让Flask-SocketIO在AWS Elastic Beanstalk(ELB)上处理我的实例,而要求通过socketio.run(application)运行Flask-SocketIO,ELB似乎是对全局应用程序的调用对象本身.

I can't quite get Flask-SocketIO working with my instance on AWS Elastic Beanstalk (ELB), with the requirement of running Flask-SocketIO with socketio.run(application), ELB appears to make the calls to the global application object itself.

ELB文档指出,使用application.py作为文件名并提供可调用的应用程序对象(在这种情况下为Flask对象)使Elastic Beanstalk可以轻松地找到应用程序的代码.

The ELB documentation states Using application.py as the filename and providing a callable application object (the Flask object, in this case) allows Elastic Beanstalk to easily find your application's code.

我的ELB实例日志显示错误RuntimeError:您需要使用事件服务器.有关更多信息,请参见文档的部署"部分.

My ELB instance logs show the error RuntimeError: You need to use the eventlet server. See the Deployment section of the documentation for more information.

假设AWS调用application.run(),有什么方法可以解决此问题?

Is there any way to approach this problem assuming that AWS calls application.run()?

预先感谢

推荐答案

Flask-SocketIO对负载均衡器和Web服务器有非常特定的要求.我认为您可以使用粘性会话配置ELB负载均衡器,这将使其起作用,但是我认为不起作用的部分是使用eventlet或gevent Web服务器,因为AWS以其自己的方式调用了callable.您需要的是使用socketio.run()或启动eventlet/gevent Web服务器的等效过程的方法.

Flask-SocketIO has very specific requirements on the load balancer and the web server. I think you can configure the ELB load balancer with sticky sessions and that would make it work, but the part that I think does not work is using the eventlet or gevent web servers, since AWS invokes the callable in its own way. What you need is a way to use socketio.run() or an equivalent procedure that starts the eventlet/gevent web server.

这篇关于在beantalk上部署flask-socketio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆