【发布时间】:2021-09-03 23:48:20
【问题描述】:
我的 AWS 实例在我的应用程序中运行良好。但是,今天,服务器在没有内存 RAM 的情况下停机。然后我运行:
sync; echo 1 > /proc/sys/vm/drop_caches
sudo service nginx start
之后,ram 内存消耗是可以的,但应用程序不行。 我在 Ubuntu 14 AWS 实例中运行带有 Ruby 2.2.2 和 nginx/1.8.0 的 Rails 4.2.1 网站。
当我访问该网站时,出现错误:
502 Bad Gateway
nginx/1.8.0
当我运行passenger-config restart-app 时,我有:
*** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.
在文件/var/log/nginx/error.log我有:
2021/06/19 13:21:12 [crit] 26618#0: *48688773 connect() to unix:/tmp/passenger.26EHXct/agents.s/server failed (2: No such file or directory) while connecting to upstream, client: XXX.XXX.34.163, server: www.XXX.com, request: "GET / HTTP/1.1", upstream: "passenger:unix:/tmp/passenger.26EHXct/agents.s/server:", host: "XXX.com"
我已经尝试过this solution 并且无法正常工作。
当我跑步时:passenger-config validate-install 我有:
Use <space> to select.
If the menu doesn't display correctly, press '!'
‣ ⬢ Passenger itself
⬡ Apache
-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
Everything looks good. :-)
当我跑步时:sudo passenger-memory-stats 我有:
Version: 5.0.10
Date : 2021-06-19 13:31:40 -0300
------------- Apache processes -------------
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.
---------- Nginx processes ----------
PID PPID VMSize Private Name
-------------------------------------
26615 1 230.7 MB 26.3 MB nginx: worker process
26616 1 230.4 MB 27.4 MB nginx: worker process
26617 1 229.7 MB 25.8 MB nginx: worker process
26618 1 233.3 MB 27.4 MB nginx: worker process
### Processes: 4
### Total private dirty RSS: 106.78 MB
--- Passenger processes ---
### Processes: 0
### Total private dirty RSS: 0.00 MB
有谁知道我该如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails ruby nginx passenger passenger-nginx