bash -l / tmp / create_inputs在Rubber>中返回拒绝连接亚马逊EC2

时间:2014-02-21 11:13:33

标签: 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" } }'

提前谢谢你们

4 个答案:

答案 0 :(得分:1)

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

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

希望它有所帮助!我被困在这里差不多三天希望看到我的网站上线:(肯定会写下我的经历。

答案 1 :(得分:1)

如果有人检查过这个。

最后我无法找到任何解决方案。我每次尝试都遇到了一个新问题,所以我放弃了,因为如果我不能在服务器上正确部署,客户就不会付钱:)

现在我正在通过Git(旧学校)手动部署我的Rails应用程序。 从那时起我就没有任何问题了。

我也在使用OpsWork,它非常有帮助。我部署了不同的图层,然后在最后添加我的Rails应用程序。我不喜欢BeanStalk以及它如何管理不同的层,因此我坚持使用OpsWork或直接通过控制台使用EC2。

干杯

答案 2 :(得分:0)

我有同样的问题。我无法弄清楚如何让Graylog正常工作,但你可以通过以下方式禁用它,有点烦人。

首先,您必须销毁现有实例。这是因为您无法修改现有ec2实例上的安全组。

cap rubber:destroy

然后,启动新实例。我正在使用升级,所以对我来说是:

cap rubber:create_staging

当你被问到应用程序的名称是什么时(我使用'staging'而不是默认的'production',但我无法想象这很重要),你会被问到你想在应用程序中使用哪些安全组。 不接受默认,而是键入所有列出的默认安全组,排除以graylog _开头的任何内容。

例如:

apache,app,collectd,common,db:primary=true,elasticsearch,examples,graphite_server,graphite_web,haproxy,mongodb,monit,passenger,postgresql,postgresql_master,web,web_tools

这就是在该步骤的方括号中重新输入(或复制)所有内容,并删除graylog条目。

有可能在配置中有另一种方法可以做到这一点,例如在rubber.yml文件中使用assigned_security_groups,但我无法弄明白。这虽然它要求我每次创建一个实例时都输入一个长字符串,但这似乎是让它工作的最快方法。

如果您找到了一种方法,可以使用橡皮泥或更简单的方法来禁用graylog,请告诉我。

希望这有用!

答案 3 :(得分:0)

相同的问题。我猜灰色日志可能不是安装/配置属性。 这肯定是一个bug。只是在寺庙中删除这个角色。