【发布时间】:2017-07-30 16:52:27
【问题描述】:
我使用 Capistrano 在生产环境中部署我的 Rails 应用程序。在大约 10 台服务器上一切正常。但是,如果我添加更多服务器(例如 5 个),我开始从 Capistrano 收到错误:
Command: export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.2.2" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/example/git-ssh.sh" ; /usr/bin/env git ls-remote --heads example@repo.example.com:repo/example.git
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as example@app4.example.com: git exit status: 128
git stdout: Nothing written
git stderr: ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
附加服务器只是克隆,因此它们具有正确的访问权限。该存储库存在并且可以在较少的服务器上正常工作。此外,当我添加新服务器时,有时会在新服务器上发生同样的故障,但有时会在旧服务器上发生。所以故障不会发生在同一台服务器上:如果我多次运行 Capistrano 部署,我会遇到同样的故障,但总是来自不同的服务器。
也许问题出在托管 git 存储库的服务器上。也许它无法处理这么多并发 ssh 连接——为什么?有没有人遇到过这个问题?我怎样才能解决这个问题?
【问题讨论】:
标签: git capistrano capistrano3