提高 Capistrano 部署的可靠性

发布于 2024-09-10 23:49:08 字数 247 浏览 0 评论 0原文

我已经使用 capistrano 很长时间了,但总是用于不重要的网站。如果出现问题,几分钟的停机时间并不是什么大问题。

现在我正在开发一项更关键的服务,需要涵盖我的边缘情况。其中之一是我与服务器的本地连接在部署过程中中断。

我能想到的一种解决方案是直接从服务器在屏幕会话内进行部署。这似乎是一个合理且明显的解决方案,但令我惊讶的是我从未在其他地方读过它,甚至在 capistrano 文档中看到过它推荐。

欢迎任何指示/提示。谢谢!

I've used capistrano for a long time, but always for sites that weren't critical. If something went wrong, a few minutes of downtime weren't a big problem.

Now I'm working on a more critical service and need to cover my edge cases. One of which is if my local connection to a server becomes interrupted in the middle of a deployment.

One solution I can think of is to do deployments directly from the server, inside of a screen session. This seems like a reasonable and obvious solution, but I'm surprised I've never read about it elsewhere or even seen it recommended in the capistrano documentation.

Any pointers / tips are welcome. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪眸﹌ 2024-09-17 23:49:08

在典型的 Capistrano 部署期间,只有一个非常小的时间窗口,其中断开的连接会导致问题。此窗口是当前版本链接到新版本并且服务器被告知重新启动的时间。如果您的连接在此之前或之后断开,那就没问题。

如果您确实需要 100% 避免断开连接,您可以登录服务器,打开屏幕会话并从最新版本文件夹进行上限部署。

There is only a very small time window during a typical Capistrano deploy where a dropped connection would cause trouble. This window is when the current release is linked to the new version and the server is told to restart. If your connection drops before or after that, you're fine.

If you positively need to be safe from disconnects 100%, you can log onto the server, open a screen session and do a cap deploy from the latest release folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文