2013-11-27 45 views
1

我在我的本地機器上試驗了在torquebox環境中的rails deploy,一切都很順利。如何運行連接到torquebox環境的軌道控制檯(在生產環境中)

我跟着他們得到了​​加上一些關於clustering,sessions replicationdistributed caching的其他建議。我也試過background jobs support

現在我的應用程序在本地兩個節點集羣上運行,所有這些東西都已就位,並且我從一個端口切換到另一個端口,仍然具有相同的會話和相同的緩存數據。

現在的問題,如何啓動連接到torquebox環境的滑軌控制檯?我的應用程序目錄與

rails c production 

嘗試和,而控制檯加載罰款,我無法從Web應用程序讀取緩存值,Rails.cache.read(:any_key)總是返回零。此外,我無法從此控制檯調用可背景方法。鑑於Search.foo是我在這個異常的backgroundable方法:

NameError: missing class or uppercase package name (`org.torquebox.core.util.StringUtils') 
    from org/jruby/javasupport/JavaUtilities.java:54:in `get_proxy_or_package_under_package' 
    from file:/Users/fabio/.rvm/rubies/jruby-1.7.8/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14:in `method_missing' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/torquebox-messaging-3.0.1-java/lib/torquebox/messaging/task.rb:33:in `queue_name' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/torquebox-messaging-3.0.1-java/lib/torquebox/messaging/backgroundable.rb:198:in `publish_message' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/torquebox-messaging-3.0.1-java/lib/torquebox/messaging/backgroundable.rb:158:in `__async_foo' 
    from (irb):2:in `evaluate' 
    from org/jruby/RubyKernel.java:1123:in `eval' 
    from org/jruby/RubyKernel.java:1519:in `loop' 
    from org/jruby/RubyKernel.java:1284:in `catch' 
    from org/jruby/RubyKernel.java:1284:in `catch' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/railties-3.2.15/lib/rails/commands/console.rb:47:in `start' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/railties-3.2.15/lib/rails/commands/console.rb:8:in `start' 
    from /Users/fabio/.rvm/gems/jruby-1.7.8/gems/railties-3.2.15/lib/rails/commands.rb:41:in `(root)' 
    from org/jruby/RubyKernel.java:1084:in `require' 
    from script/rails:6:in `(root)' 

這種情況既Search.fooSearch.background.foo

我也嘗試使用以下命令

torquebox exec /full/path/to/app-knob.yml 'rails c production' 
bundle exec torquebox exec /full/path/to/app-knob.yml 'rails c production' 
運行控制檯

隨着他們我得到錯誤

chmod: vendor/bundle/jruby/1.9/bin/*: No such file or directory 

我錯過了什麼嗎?

最後一個音符,我/config/torquebox.rb文件我已經

TorqueBox.configure do 

    environment do 
    RAILS_ENV 'production' 
    GEM_HOME "#{ENV['rvm_path']}/gems/jruby-1.7.8" 
    GEM_PATH "#{ENV['rvm_path']}/gems/jruby-1.7.8:#{ENV['rvm_path']}/gems/[email protected]" 
    end 

    options_for Backgroundable, concurrency: 10 
end 

我已經試過與不GEM_* ENV變量

回答

3

嘗試https://github.com/torquebox/torquebox-console,但坦率地說我開始後悔去爲Torquebox,搞笑併發症和其他不必要的箍跳在它的使用周圍發芽,但tbconsole是一個有用的工具,它具有網絡變體等,請檢查它 - 但在生產中謹慎使用它,它使開發扭矩盒實例開始表現古怪(在至少對我來說),這留下了「正在進行的工作「感覺使用了幾個月後。另外,作爲解決方法,您可以設置一個「開發」環境,連接生產主機上的生產數據庫,但在與HornetQ等集成功能或任何依賴於此類功能的任何其他功能進行接口連接時,您應該會遇到問題,例如https://issues.jboss.org/browse/TORQUE-1175 - Torquebox團隊似乎並不急於解決這些問題。

+0

謝謝你的提示,我會盡力的。無論如何,我想嘗試使用扭矩盒來支持其開箱即用的集羣,這對於高流量生產應用程序非常有用。這只是一個實驗... – Fabio

+0

它當然*看起來*令人印象深刻,我還沒有放棄 – bbozo

相關問題