部署到 slicehost 时出现 Capistrano 错误
我正在尝试使用 capistrano 在 slicehost 中部署应用程序。我可以使用相同的凭据通过 SSH 登录,但是当我尝试部署它时,出现以下错误:
- 执行 `deploy'
- 执行 `deploy:update' ** 事务:开始
- 执行 `deploy:update_code' 更新所有服务器上的缓存结账 本地执行: "git ls-remote [email protected]:xxx.git master”
- 执行“if [ -d /home/sdn/shared/cached-copy ]; 然后 cd /home/xxx/shared/cached-copy && git fetch -q origin && -hard 910a97024a45f1304d6b50c8862605ea0f1cf829 && git clean -q -d -x -f; else git clone -q [电子邮件受保护]:xxx.git /home/xxx/shared/cached-copy && cd /home/xxx/shared/cached-copy && git checkout -q -b部署 910a97024a45f1304d6b50c8862605ea0f1cf829; 服务器:[“173.203.79.208”] *** [deploy:update_code] 回滚
- 执行“rm -rf /home/xxx/releases/20100506160548; true” 服务器:[“173.203.79.208”] ** [deploy:update_code] 回滚时出现异常:Capistrano::ConnectionError,连接失败:173.203.79.208(Net::SSH::Disconnect:连接被远程主机关闭) 连接失败:173.203.79.208(Net::SSH::Disconnect:连接被远程主机关闭)
我做错了什么?我应该添加什么到我的deploy.rb文件中才能让它与slicehost一起工作?
im trying to deploy an application in slicehost using capistrano. I can log in via SSH using the same credentials, however when I try to deploy it i get the following error:
- executing `deploy'
- executing `deploy:update'
** transaction: start - executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]:xxx.git master" - executing "if [ -d /home/sdn/shared/cached-copy ]; then cd /home/xxx/shared/cached-copy && git fetch -q origin && git reset -q --hard 910a97024a45f1304d6b50c8862605ea0f1cf829 && git clean -q -d -x -f; else git clone -q [email protected]:xxx.git /home/xxx/shared/cached-copy && cd /home/xxx/shared/cached-copy && git checkout -q -b deploy 910a97024a45f1304d6b50c8862605ea0f1cf829; fi"
servers: ["173.203.79.208"]
*** [deploy:update_code] rolling back - executing "rm -rf /home/xxx/releases/20100506160548; true"
servers: ["173.203.79.208"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: 173.203.79.208 (Net::SSH::Disconnect: connection closed by remote host)
connection failed for: 173.203.79.208 (Net::SSH::Disconnect: connection closed by remote host)
What am I doing wrong? is anything I should add to my deploy.rb file in order to get it to work with slicehost?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Slicehost 是否有权从您的 git 服务器克隆存储库?如果您的 git 服务器需要 ssh 身份验证,您必须在主机上生成 ssh 密钥,并将主机的公钥放在 git 服务器上。
如果不是这样,那么它似乎与在主机上运行 git 相关。但是“(Net::SSH::Disconnect: 连接被远程主机关闭)” 听起来像是身份验证问题。
Does Slicehost have permission to clone a repository from your git server? If your git server requires ssh authentication, you'll have to generate ssh keys on your host, and put your host's public key on your git server.
If it's not that, then it appears that it's something else related to running git on your host. But "(Net::SSH::Disconnect: connection closed by remote host)" smells like an authentication issue.
我有同样的问题。
我已经在railsu和git中创建了.ssh文件。但是这个问题也在这里。
所以我不认为这个错误是身份验证问题。
I have the same problem.
I already create the .ssh file in the railsu and git .But this problem also here.
So I don't think this error is authentication issue.
您可以按照克林顿的建议在服务器上生成密钥,也可以启用 SSH 代理转发。
这意味着您无需在服务器上生成新的 SSH 密钥。您使用部署所在计算机上已有的密钥,并且该密钥转发以在服务器上使用以连接到您的 git 服务器。
您可以将
ssh_options[:forward_agent] = true
添加到您的 capistrano 配方中,或将主机配置添加到您的~/.ssh/config
中,如下所示:我更喜欢后者。
有一个非常关于 SSH 代理转发的详尽指南www.unixwiz.net
You can generate a key on your server as Clinton suggests, or you can enable SSH Agent Forwarding.
This means you won't have to generate a new SSH key on your server. You use the the key already on the machine you're deploying from and the key is forwarded for use on the server to connect to your git server.
You can add
ssh_options[:forward_agent] = true
to your capistrano recipe or add a Host config to your~/.ssh/config
like this:I prefer the later.
There's a very thorough guide to SSH Agent Forwarding over at www.unixwiz.net