我用nginx配置了我的瘦服务器,并且我的ROR应用程序正在它们上运行。
在发布代码更新时运行thin restart会给应用程序带来一些停机时间。我试图弄清楚如何从容地重新启动正在运行的瘦实例,但我找不到一个好的解决方案。
有没有人能够做到这一点?
发布于 2012-07-26 05:27:53
# Restart just the thin server described by that config
sudo thin -C /etc/thin/mysite.yml restart Nginx将继续运行和代理请求。如果您将Nginx设置为使用多个上游服务器,例如
server {
listen 80;
server_name myapp.mysite.com;
# ...
location / {
try_files $uri $uri/index.html /cache$uri.html $uri.html @proxy;
}
location @proxy {
proxy_pass http://myapp.rails;
}
}
upstream myapp.rails {
server 127.0.0.1:9001 max_fails=1 fail_timeout=10s;
server 127.0.0.1:9002 max_fails=1 fail_timeout=10s;
server 127.0.0.1:9003 max_fails=1 fail_timeout=10s;
}…然后,每个实例将轮流重启,如果其中一个代理关闭,Nginx将自动路由请求。
https://stackoverflow.com/questions/11657741
复制相似问题