服务器启动时访问服务器的原因是什么?
我已经rhc tail
在我的应用程序上运行以监控新日志。
这是我的日志 http://laravel.io/bin/Dez4o
当我使用启动应用程序时rhc app-start
应用程序根/日志/php-fpm-error.log
[26-Jul-2016 21:53:00] NOTICE: [pool www] 'user' directive is ignored
when FPM is not running as root
[26-Jul-2016 21:53:00] NOTICE: [pool www] 'group' directive is ignored
when FPM is not running as root
[26-Jul-2016 21:53:00] NOTICE: fpm is running, pid 33590
[26-Jul-2016 21:53:00] NOTICE: ready to handle connections
应用程序根/日志/haproxy.log
[WARNING] 207/215259 (33493) : config : log format ignored for proxy 'stats' since it has no log address.
[WARNING] 207/215259 (33493) : config : log format ignored for proxy 'express' since it has no log address.
[WARNING] 207/215259 (33493) : Server express/local-gear is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 207/215259 (33493) : proxy 'express' has no server available!
应用程序根/日志/haproxy_ctld.log
I, [2016-07-26T21:52:59.962585 #33508] INFO -- : Starting haproxy_ctld
nginx/logs/error.log
2016/07/26 21:53:03 [warn] 36575#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /var/lib/openshift/578775d489f5cf4fc100019f/nginx//conf/nginx.conf:2
应用程序根/日志/nginx_access.log
(my.sever.ip.address) - - [26/Jul/2016:21:53:06 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:08 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:10 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
应用程序根/日志/haproxy.log
[WARNING] 207/215310 (33493) : Server express/local-gear is UP, reason: Layer7 check passed, code: 302, info: "HTTP status check returned code <3C>302<3E>", check duration: 69ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
应用程序根/日志/nginx_access.log
(my.sever.ip.address) - - [26/Jul/2016:21:53:12 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:14 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:16 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:18 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:20 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:22 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
然后我尝试访问我的网站根目录
(my.sever.ip.address) - - [26/Jul/2016:21:53:24 -0400] 200 "GET /login HTTP/1.1" 1422 "-" "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" "(my.client.ip.address)"
(my.sever.ip.address) - - [26/Jul/2016:21:53:24 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:25 -0400] 200 "GET /components/AdminLTE/bootstrap/css/bootstrap.min.css HTTP/1.1" 23930 "http://dev-teleradportal.rhcloud.com/login" "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" "(my.client.ip.address)"
(my.sever.ip.address) - - [26/Jul/2016:21:53:25 -0400] 200 "GET /components/AdminLTE/plugins/font-awesome/css/font-awesome.min.css HTTP/1.1" 6734 "http://dev-teleradportal.rhcloud.com/login" "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" "(my.client.ip.address)"
... other assets
但加载后日志继续
(my.sever.ip.address) - - [26/Jul/2016:21:53:26 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:29 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:31 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
(my.sever.ip.address) - - [26/Jul/2016:21:53:33 -0400] 302 "GET / HTTP/1.0" 364 "-" "-" "-"
然后我执行了rhc app-stop
停止服务器
这些是执行“停止”后的日志
应用程序根/日志/php-fpm-error.log
[26-Jul-2016 21:53:55] NOTICE: Terminating ...
[26-Jul-2016 21:53:55] NOTICE: exiting, bye-bye!
nginx/logs/error.log
2016/07/26 21:53:55 [warn] 37102#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /var/lib/openshift/578775d489f5cf4fc100019f/nginx//conf/nginx.conf:2
2016/07/26 21:53:55 [notice] 37102#0: signal process started
这access logs
所描述的行为与 haproxy 的 http 健康检查相匹配。创建新会话是因为 haproxy 不会在健康检查之间保留 cookie,因此您的应用程序 (Laravel) 将请求视为新浏览会话的第一个请求。
您可以将您的健康检查 url 重新配置为不使用会话的东西以避免创建会话文件,但这意味着即使会话功能被破坏,健康检查也会通过。
来源:http ://cbonte.github.io/haproxy-dconv/1.6/snapshot/configuration.html#inter