lundi 27 juillet 2015

Deploying a Django project on Amazon ec2 with gunicorn + nginx Connection in use issue

I've been running a django project on an ubuntu ec2 instance with gunicorn and nginx. I know it was running for at least a couple days, but I just checked in on it, and it is no longer running. I put in my usual gunicorn command, sudo gunicorn adventure_time.wsgi:application –b 127.0.0.1:8001 but all I get is

[2015-07-28 05:14:47 +0000] [11164] [INFO] Starting gunicorn 19.3.0
[2015-07-28 05:14:47 +0000] [11164] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2015-07-28 05:14:47 +0000] [11164] [ERROR] Retrying in 1 second.
[2015-07-28 05:14:48 +0000] [11164] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2015-07-28 05:14:48 +0000] [11164] [ERROR] Retrying in 1 second.
[2015-07-28 05:14:49 +0000] [11164] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2015-07-28 05:14:49 +0000] [11164] [ERROR] Retrying in 1 second.
[2015-07-28 05:14:50 +0000] [11164] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2015-07-28 05:14:50 +0000] [11164] [ERROR] Retrying in 1 second.
[2015-07-28 05:14:51 +0000] [11164] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2015-07-28 05:14:51 +0000] [11164] [ERROR] Retrying in 1 second.
[2015-07-28 05:14:52 +0000] [11164] [ERROR] Can't connect to ('127.0.0.1', 8000)

netstat -tulpn shows me this:

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:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      11126/nginx: worker
tcp6       0      0 :::22                   :::*                    LISTEN      -
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -
udp        0      0 0.0.0.0:30444           0.0.0.0:*                           -
udp6       0      0 :::63162                :::*                                -

So... it seems like nothing is running on 127.0.0.1:8000. Nothing for me to kill. (I've also tried sudo pkill gunicorn)Anyone got some tips on what I can do get my site running again? Also, why is it that gunicorn is still trying to connect to port 8000, but in my command I've asked it to connect to 8001? Thanks!!




Aucun commentaire:

Enregistrer un commentaire