我在我的本地機器上試驗了在torquebox環境中的rails deploy,一切都很順利。如何運行連接到torquebox環境的軌道控制檯(在生產環境中)
我跟着他們得到了加上一些關於clustering,sessions replication和distributed 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.foo
和Search.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變量
謝謝你的提示,我會盡力的。無論如何,我想嘗試使用扭矩盒來支持其開箱即用的集羣,這對於高流量生產應用程序非常有用。這只是一個實驗... – Fabio
它當然*看起來*令人印象深刻,我還沒有放棄 – bbozo