Capistrano 通过 :app、:web、:db 主计算机连接到第二个服务器

发布于 2025-01-01 00:44:26 字数 489 浏览 3 评论 0原文

我正在尝试使 capistrano 连接到第二台服务器,而不是通过“角色”定义定义的服务器,以便连接到一台特定服务器,在其上运行 mysqldump,并将新转储 scp 到 :app,:web主持人。

所以这就是我写的:

server "staging.app.com", :app, :web, :db, :primary => true
server "legacyserver.com", :origin_server

我希望仅在需要时连接到 :origin_server ,即当我需要运行 mysqldump 和 scp 时。但是,当启动 cap%env%deploy 时,capistrano 会记录 :

    servers: ["staging.app.com", "legacyserver.com"]

并尝试使用相同的输入凭据登录到两台计算机。

我可能会缺少什么?谢谢。

I'm trying to make capistrano connect to a second server than the ones defined throught the 'role' definitions, in order to connect to one specific server, run a mysqldump on it, and scp the fresh dump to the :app,:web host.

So here's what I wrote :

server "staging.app.com", :app, :web, :db, :primary => true
server "legacyserver.com", :origin_server

I wish to connect to :origin_server only when needed, i.e when I need to run mysqldump and scp of it. But, when launching cap %env% deploy, capistrano logs :

    servers: ["staging.app.com", "legacyserver.com"]

and tries to log to both machines using the same entered credentials.

What could I be missing ? Thanks.

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

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

发布评论

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

评论(1

对你的占有欲 2025-01-08 00:44:26

您可以将 :orinal _server 设置为非发布服务器。为此,您需要添加以下内容:

server "legacyserver.com", :orginal_server, :no_release => true

现在,如果有明确说明,任务将仅在此服务器上运行。

You can set the :orginal _server to be a non release server. To do this you need to add this:

server "legacyserver.com", :orginal_server, :no_release => true

Now tasks will only be run on this server if specifically stated.

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