部署 Rails 部署问题

mumu · 2016年03月30日 · 最后由 michael 回复于 2016年04月01日 · 2633 次阅读

参考以下帖子进行自动化部署 https://ruby-china.org/topics/26132 提示

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the ECDSA key sent by the remote host is
    SHA256:LIAigbrFP6Y48g0Z+nqbG+ufP7aLwQJUF78trup7Rsw.
    Please contact your system administrator.
    Add correct host key in /home/dbp/.ssh/known_hosts to get rid of this message.
    Offending ECDSA key in /home/dbp/.ssh/known_hosts:5
    remove with:
    ssh-keygen -f "/home/dbp/.ssh/known_hosts" -R 10.68.2.17
    Password authentication is disabled to avoid man-in-the-middle attacks.
    Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
    Permission denied (publickey,password).

疑问:

  1. 目标服务器的 host key 如何生成,生成后直接添加到 /home/dbp/.ssh/known_hosts?
  2. 在使用自动化部署工具的时候,目标服务器需要安装开发环境吗?
  3. 种子文件、创建数据库、迁移文件需要单独执行吗?
  4. 生成存储过程、触发器、创建索引等操作可以通过迁移文件生成吗?如果可以不能迁移文件生成,并且自动化部署时可以自动执行迁移文件,那这类脚本需要单独执行,还是有其他办法实现部署时自定执行?
  1. 添加本地 ssh key 到 目标服务器,最终的效果就是 ssh 连接服务器的时候不需要输入密码;

  2. 要,可使用 rvm 之类的工具;

  3. deploy 时会自动构建;

  4. 存储过程,触发器没有试过,不清楚,索引可以,索引可以创建成 migration,触发器这些可以找找资料看,如果需要单独写脚本,也可以写到 deploy config 下面,执行对应的 shell;

我最近也在折腾 rails 你的问题我也都遇到过 有些谷歌就解决了

我建议多自己查和尝试 或者直接交流~~

#4 楼 @mumu hi 你解决了吧?

@mumu

remove with:
ssh-keygen -f "/home/dbp/.ssh/known_hosts" -R 10.68.2.17

注意看这一行,意思是你本机的 /home/dbp/.ssh/known_hosts 文件里面有远程机器:10.68.2.17 的一些信息,但不正确了,你可以试着把 本机 known_hosts 文件里面,与这个 IP 相关的那一行删除掉,先重新 ssh 一次,输入 yes,再重新部署一次

另外,部署推荐 mina: http://nadarei.co/mina/ https://github.com/mina-deploy/mina

文档比较全,学习成本也不高哈。

#5 楼 @dddx #6 楼 @zfjoy520 谢谢大家,折腾了半年 rails,越来越发现,入门很快,想要提升,想要真正理解 rails 的高效真的需要学习太多东西了 节后就要继续做.net 开发了…………

@mumu 。。又做回.net 么?可惜呢

要什么自行车!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号