ruby-on-rails - bash -l/tmp/create_inputs 返回在 Rubber > Amazon EC2 中被拒绝的连接

标签 ruby-on-rails ubuntu curl amazon-web-services amazon-ec2

在与 Amazon EC2 打交道 36 小时后,我坚持使用以下内容。

当 Rubber 到达运行 deploy-graylog.rb 时,我收到此错误:

这是执行最后一部分的日志:

** [out :: production.foo.com.au] graylog-web start/running, process 12772
    command finished in 750ms
    triggering after callbacks for `rubber:graylog:web:bootstrap'
  * 2014-02-21 22:01:24 executing `rubber:graylog:web:create_inputs'
    servers: ["production.foo.com.au"]
 ** sftp upload #<StringIO:0x007fb47410aec0> -> /tmp/create_inputs
    [production.foo.com.au] /tmp/create_inputs
    [production.foo.com.au] done
  * sftp upload complete
  * executing "sudo -p 'sudo password: '  bash -l /tmp/create_inputs"
    servers: ["production.foo.com.au"]
    [production.foo.com.au] executing command
 ** [out :: production.foo.com.au] curl: (7) Failed connect to localhost:12900; Connection refused
    command finished in 725ms
failed: "/bin/bash -l -c 'sudo -p '\\''sudo password: '\\''  bash -l /tmp/create_inputs'" on production.foo.com 

当我通过 SSH 连接到服务器并直接运行此 bash -l/tmp/create_inputs 时,我得到了同样的错误

我什至需要 Graylog 吗?如果不能,我该如何禁用它?

服务器是 Ubuntu,m1.small ruby 2.0.0-p353 rails 4.0.2

这是/etc/hosts

127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
## rubber config production
10.248.163.48 production.foo.com.au production ec2-54-206-206-214.ap-southeast-2.compute.amazonaws.com ip-10-248-163-48.ap-southeast-2.compute.internal elasticsearch-production.foo.com.au graphite-production.foo.com.au graylog-production.foo.com.au
## rubber config production

这是/tmp/create_inputs 中的内容

function error_exit { exit 99; }; trap error_exit ERR
          curl --user admin:admin1 -XPOST http://localhost:12900/system/inputs -H "Content-Type: application/json" -d '{"type": "org.graylog2.inputs.gelf.udp.GELFUDPInput", "creator_user_id": "admin", "title": "gelf-udp", "global": true, "configuration": { "port": 12201, "bind_address": "0.0.0.0" } }'
          curl --user admin:admin1 -XPOST http://localhost:12900/system/inputs -H "Content-Type: application/json" -d '{"type": "org.graylog2.inputs.syslog.udp.SyslogUDPInput", "creator_user_id": "admin", "title": "syslog-udp", "global": true, "configuration": { "port": 12514, "bind_address": "0.0.0.0" } }'

先谢谢大家

最佳答案

上面建议的同样的事情可以通过这种方式完成。我相信这将是更好的方法。使用 cap rubber:remove_role 命令 https://github.com/rubber/rubber/wiki/Commands .

1) cap rubber:remove_role -- 提示您输入实例名称说“production” 2)然后它会询问您的角色---删除您不需要的角色。您可以在上面的日志中查看它们。易于复制和粘贴

希望对您有所帮助!我坚持了将近三天,希望能看到我的网站上线 :( 肯定会在博客上写下我的经历。

关于ruby-on-rails - bash -l/tmp/create_inputs 返回在 Rubber > Amazon EC2 中被拒绝的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21932825/

相关文章:

ruby-on-rails - 如何在 rails/rack 应用程序上与 node.js 实例共享身份验证?

ruby-on-rails - 在检查机器人的函数中使用中断时,Ruby 函数返回 true 而不是 false

python - Python 应用程序需要 init.d 脚本

ubuntu - 入口点脚本 : "no such file or directory" 上的 Docker 错误

azure - 牛津语音项目 API 的客户端 ID

c++ - 在 C++ 中将数据作为 void* 传递

ruby-on-rails - 安装 ruby​​ debug19。编译器无法生成可执行文件

ruby-on-rails - Mina 和 Devise.secret_key 未设置

ubuntu - 无法禁用 Ansible 的主机 key 检查

c# - System.Net.Http.MultipartFormDataContent 的 "curl -F"参数是否等效?