最近重新部署了一下应用程序,之后重新运行gunicorn,使用如下命令:

gunicorn -b 0.0.0.0:8000 manage:app --reload

之后出现了一堆错误,具体错误内容如下:

[2018-06-16 17:04:59 +0800] [24890] [INFO] Starting gunicorn 19.8.1
[2018-06-16 17:04:59 +0800] [24890] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2018-06-16 17:04:59 +0800] [24890] [ERROR] Retrying in 1 second.
[2018-06-16 17:05:00 +0800] [24890] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2018-06-16 17:05:00 +0800] [24890] [ERROR] Retrying in 1 second.
[2018-06-16 17:05:01 +0800] [24890] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2018-06-16 17:05:01 +0800] [24890] [ERROR] Retrying in 1 second.
[2018-06-16 17:05:02 +0800] [24890] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2018-06-16 17:05:02 +0800] [24890] [ERROR] Retrying in 1 second.
[2018-06-16 17:05:03 +0800] [24890] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2018-06-16 17:05:03 +0800] [24890] [ERROR] Retrying in 1 second.
[2018-06-16 17:05:04 +0800] [24890] [ERROR] Can't connect to ('0.0.0.0', 8000)

一直尝试连接8000端口,这个应该是gunicorn没有关闭。

查看一下占用情况:

netstat -tulpn

可以看到如下内容:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 16528/beam
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1425/mysqld
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 9093/sendmail: MTA:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20372/nginx -g daem
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 16621/epmd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1004/sshd
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 16528/beam
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 9093/sendmail: MTA:
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 22627/python3.5
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 11530/zabbix_agentd
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 4093/zabbix_server
tcp6 0 0 :::5672 :::* LISTEN 16528/beam
tcp6 0 0 :::80 :::* LISTEN 20372/nginx -g daem
tcp6 0 0 :::4369 :::* LISTEN 16621/epmd
tcp6 0 0 :::1017 :::* LISTEN 4564/IntelliJIDEALi
tcp6 0 0 :::5050 :::* LISTEN 29792/dotnet
tcp6 0 0 :::10050 :::* LISTEN 11530/zabbix_agentd
tcp6 0 0 :::10051 :::* LISTEN 4093/zabbix_server
udp 0 0 10.104.102.216:123 0.0.0.0:* 1195/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 1195/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 1195/ntpd
udp 0 0 127.0.0.1:161 0.0.0.0:* 1239/snmpd
udp 0 0 0.0.0.0:47718 0.0.0.0:* 1239/snmpd
udp6 0 0 :::123 :::* 1195/ntpd

重点是这个内容:

tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 4093/zabbix_server

PID为4093的程序占用了8000端口,直接杀掉进程,命令如下:

kill -9 4093

之后再次运行gunicorn,命令如下:

gunicorn -b 0.0.0.0:8000 manage:app --reload

已经成功运行,截图如下:

https://pdf-lib.org/Home/Details/5262

最新文章

  1. AssetBundle
  2. linux下gimp的使用
  3. 【贪心】最大乘积-贪心-高精度-java
  4. ViewPager和Tabhost结合,可滑动的tabhost
  5. js 完成对图片的等比例缩放的方法
  6. Android编程中常用的PopupWindow和Dialog对话框
  7. 【原】Spark Rpc通信源码分析
  8. HaoZip(好压) 去广告纯净版 4.4
  9. Docker(四):Docker 三剑客之 Docker Compose
  10. Docker使用 Supervisor 来管理进程
  11. C# 动态生成word文档
  12. leetcode-58.最后一个单词的长度
  13. pycharm快捷键帮助文档Keymap Reference
  14. 基于 SSL 的 Nginx 反向代理
  15. C# 监控代码执行效率
  16. hive创建orc表,使用LLAP查询
  17. jQuery获取子元素的个数
  18. 转: Orz是一个基于Ogre思想的游戏开发架构
  19. Ajax请求数据的两种方式
  20. 二叉树的层次遍历 · Binary Tree Level Order Traversal

热门文章

  1. Could not find modernizr-2.6.2 in any of the sources GitLab: API is not accessible
  2. MySQL - MyCat 实现读写分离
  3. 第三章 K近邻法(k-nearest neighbor)
  4. linux centos7安装mysql
  5. S - Cyclic Components (并查集的理解)
  6. ACM_排序
  7. sql剪切数据
  8. Python批量下载电视剧电影--自己动手丰衣足食
  9. 关于串通京东接口的demo
  10. 创建密码带有特殊字符的dblink