uWSGI + nginx + Flask: сайт не доступен - PullRequest
0 голосов
/ 08 мая 2019

Около месяца назад я закончил настройку сервера AWS EC2 Ubuntu 18.04 для запуска приложения Flask.С тех пор я занимаюсь разработкой и тестированием на местном уровне.Сегодня я попытался запустить свое приложение, но не могу подключиться к нему.Когда я набираю URL, он просто говорит: «Этот сайт не может быть достигнут X. Слишком долго, чтобы ответить».

Чтобы настроить его, я почти точно следовал этому учебнику .

Может кто-нибудь помочь мне диагностировать проблему?Я уверен, что есть некоторые команды, которые я могу набрать, чтобы показать, что происходит, но, к сожалению, я их не знаю.

Вот вывод моего файла .log после выполнения sudo systemctl restart nginx, sudo systemctl restart registration.

SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
worker 3 buried after 1 seconds
worker 4 buried after 1 seconds
worker 5 buried after 1 seconds
goodbye to uWSGI.
VACUUM: unix socket registration.sock removed.
*** Starting uWSGI 2.0.18 (64bit) on [Wed May  8 15:51:18 2019] ***
compiled with version: 7.3.0 on 21 March 2019 16:04:33
os: Linux-4.15.0-1035-aws #37-Ubuntu SMP Mon Mar 18 16:15:14 UTC 2019
nodename: ip-xxx-xx-xx-xx
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/ubuntu/registration
detected binary path: /home/ubuntu/registration/registration-venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 3841
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address registration.sock fd 3
Python version: 3.6.7 (default, Oct 22 2018, 11:32:17)  [GCC 8.2.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x55b917135450
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 437520 bytes (427 KB) for 5 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x55b917135450 pid: 1967 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1967)
spawned uWSGI worker 1 (pid: 1985, cores: 1)
spawned uWSGI worker 2 (pid: 1986, cores: 1)
spawned uWSGI worker 3 (pid: 1987, cores: 1)
spawned uWSGI worker 4 (pid: 1988, cores: 1)
spawned uWSGI worker 5 (pid: 1991, cores: 1)

sudo systemctl status nginx

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/nginx.service.d
           └─override.conf
   Active: active (running) since Wed 2019-05-08 15:51:14 UTC; 6min ago
     Docs: man:nginx(8)
  Process: 1938 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
  Process: 1959 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
  Process: 1953 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 1941 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 1957 (nginx)
    Tasks: 2 (limit: 1152)
   CGroup: /system.slice/nginx.service
           ├─1957 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─1960 nginx: worker process

May 08 15:51:14 ip-172-31-29-16 systemd[1]: Stopped A high performance web server and a reverse proxy server.
May 08 15:51:14 ip-172-31-29-16 systemd[1]: Starting A high performance web server and a reverse proxy server...
May 08 15:51:14 ip-172-31-29-16 systemd[1]: Started A high performance web server and a reverse proxy server.

sudo systemctl status registration

● registration.service - uWSGI instance to serve registration
   Loaded: loaded (/etc/systemd/system/registration.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-05-08 15:51:18 UTC; 6min ago
 Main PID: 1967 (uwsgi)
    Tasks: 6 (limit: 1152)
   CGroup: /system.slice/registration.service
           ├─1967 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1985 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1986 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1987 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1988 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           └─1991 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini

May 08 15:51:18 ip-172-31-29-16 systemd[1]: Stopped uWSGI instance to serve registration.
May 08 15:51:18 ip-172-31-29-16 systemd[1]: Started uWSGI instance to serve registration.
May 08 15:51:18 ip-172-31-29-16 uwsgi[1967]: [uWSGI] getting INI configuration from registration.ini
...