gunicorn部署flask项目命令

1、在没有gunicorn配置文件的时候启动flask项目    $ gunicorn -w 2 -b 127.0.0.1:8000 test:app(2代表启动2个进程,127.0.0.1:8000指绑定本机ip和端口号,test指flask的程序名字,app是flask程序里面的实例)

2、在有gunicorn配置文件的时候启动flask项目        $ gunicorn -c gconfig.py test:app(gconfig.py指gunicorn的配置文件,test指flask的程序名字,app是flask程序里面的实例)

3、查看gunicorn的运行pid号    pstree -ap|grep gunicorn

4、关闭gunicorn    kill -9 1234(gunicorn主线程号)

5、重启gunicorn     kill -HUP 1234

详情:https://www.jianshu.com/p/260f18aa5462

猜你喜欢

转载自www.cnblogs.com/qiaoer1993/p/12097464.html