【问题标题】:running and configuring rhoconnect as an instance on heroku在 heroku 上运行和配置 rhoconnect 作为实例
【发布时间】:2012-04-06 12:51:15
【问题描述】:

我正在尝试在 heroku 上将 rhoconnect 作为一个单独的应用程序运行(这实际上可能吗?),以及一个 rails 后端应用程序(不是插件,它不支持我对后端 rails 应用程序的设计身份验证)。这是为了启用与我的 rhodes android 应用程序和 rails 后端之间的同步。

我可以在本地启动 rhoconnect,并在本地启动 redis 服务器

我在 heroku 上的 rhoconnect 应用程序中添加了一个 redistogo 插件。 我遇到的问题是当我将 rhoconnect 部署到 heroku 时,应用程序无法连接到 redis 服务器(redistogo)。我使用以下设置在 settings.yml 中配置 rhoconnect:

#Sources
:sources:
  Interest:
    :poll_interval: 300

:development:
  :licensefile: settings/license.key
  :redis: 127.0.0.1:6379
  :syncserver: http://localhost:9292/api/application/
:test:
  :licensefile: settings/license.key
  :redis: 127.0.0.1:6379
  :syncserver: localhost:9292/api/application/
:production:
  :licensefile: settings/license.key
  :redis: redis://redistogo:XXXredistogopwdXXX@pike.redistogo.com:9393
  :syncserver: http://localhost:9292/api/application/</code>

部署到 heroku 后,我无法从浏览器访问 rhoconnect 应用程序。 heroku logs --app myapp

我看到应用程序崩溃了:

2012-03-21T23:01:25+00:00 heroku[web.1]:使用命令 `thin -p 启动进程
26946 -e 生产 -R /home/heroku_rack/heroku.ru 开始`
2012-03-21T23:01:27+00:00 应用程序 [web.1]: [04:01:27 PM 2012-03-21] Rhoconnect 服务器
 v3.1.1 开始...
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
esque-1.19.0/lib/resque/server.rb:12:in `'
2012-03-21T23:01:27+00:00 app[web.1]::public 不再用于避免过载
ding Module#public,改用 :public_folder
2012-03-21T23:01:27+00:00 应用程序 [web.1]:/app/.bundle/gems/ruby/1.9.1/gems/redis-2。
2.2/lib/redis/connection/ruby.rb:26:in `initialize': getaddrinfo: 名称或服务
e 未知 (SocketError)
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/connection/ruby.rb:26:in `new'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/connection/ruby.rb:26:in `block in connect'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/1.9.1/timeo
ut.rb:57:in `timeout'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/connection/ruby.rb:128:in `with_timeout'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/connection/ruby.rb:25:in `connect'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:227:in `建立连接'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:23:in `connect'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:247:in `ensure_connected'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:137:in `block in process'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:136:在“进程”中
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:206:in `logging'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis/client.rb:46:in `call'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis.rb:157:in `block in get'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/1.9.1/monit
or.rb:201:in `mon_synchronize'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
edis-2.2.2/lib/redis.rb:156:in `get'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
hoconnect-3.1.1/lib/rhoconnect/model.rb:51:in `is_exist?'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
hoconnect-3.1.1/lib/rhoconnect.rb:94:in `start_app'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
hoconnect-3.1.1/lib/rhoconnect.rb:85:in `bootstrap'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r
hoconnect-3.1.1/lib/rhoconnect.rb:308:in `initializer'
2012-03-21T23:01:27+00:00 app[web.1]: 来自 /app/application.rb:24:in `initiali
泽'
2012-03-21T23:01:27+00:00 app[web.1]: 来自 /app/application.rb:41:in `'
2012-03-21T23:01:27+00:00 应用程序 [web.1]: 来自 config.ru:37:in `require'
2012-03-21T23:01:27+00:00 app[web.1]: 来自 config.ru:37:in `block (3 levels) i
n '
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:23:in `
评估'
2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:23:in `
' 中的块(3 个级别) 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `instance_eval' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `initialize' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:120:in `new' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:120:in `map' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:18:in `
' 中的块(2 个级别) 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `instance_eval' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `initialize' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:11:in ` 新的' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:11:in ` 阻塞在
' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `instance_eval' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /app/.bundle/gems/ruby/1.9.1/gems/r ack-1.3.6/lib/rack/builder.rb:51:in `initialize' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:1:in `n 呃' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /home/heroku_rack/heroku.ru:1:in `' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/lib/thin/runner.rb:143:in `运行! 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/bin/thin:19:in `' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/bin/thin:19:in `load ' 2012-03-21T23:01:27+00:00 应用程序 [web.1]:来自 /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems/thin-1.2.6/bin/thin:6:in `' 2012-03-21T23:01:28+00:00 heroku[web.1]:进程以状态 1 退出 2012-03-21T23:01:28+00:00 heroku[web.1]:状态从开始变为崩溃

有没有人测试过类似的设置,知道如何更改 settings.yml 中的 redis 实例 URL?我已经尝试了很多选项。

【问题讨论】:

    标签: ruby-on-rails ruby heroku redis rhomobile


    【解决方案1】:

    我想我刚刚选择了错误的托管 rhoconnect 选项。结论是 heroku 上的堆栈不符合 rhoconnect 应用程序的要求。

    我将我的应用程序移至亚马逊 EC2 上的一个微型实例并在那里运行它。后端应用仍在 heroku 上,但最初希望免费测试该功能。

    在微实例上安装 rvm、ruby、rhoconnect 和 redis,拉取 git repo 并部署。不过,将所有应用程序都放在一个云下会很棒。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-31
      • 1970-01-01
      • 2012-09-14
      • 1970-01-01
      相关资源
      最近更新 更多