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程序里面的實例)      

gunicorn get_price_api:server -w 4 -b 127.0.0.1:3652 --pid /data/flask/task/spider_one/log/gunicorn.pid --access-logfile /data/flask/task/spider_one/log/flaskaccess.log

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM