Foreman退出代码为0?

时间:2012-12-13 00:09:01

标签: ruby-on-rails sunspot foreman

我安装了Foreman gem,以便每次运行我的应用程序时启动Sunspot:

Procfile:

search: bundle exec rake sunspot:solr:start

这是输出:

alex@alex-K43U:~/rails/inkleak$ foreman start
08:05:09 search.1 | started with pid 5278
08:05:35 search.1 | java version "1.6.0_24"
08:05:35 search.1 | OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~11.10.1)
08:05:35 search.1 | OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
08:05:35 search.1 | Removing stale PID file at /home/alex/rails/inkleak/solr/pids/development/sunspot-solr-development.pid
08:05:35 search.1 | Successfully started Solr ...
08:05:35 search.1 | exited with code 0
08:05:35 system   | sending SIGTERM to all processes
SIGTERM received

可能是什么问题?

(顺便说一下,当我做rake sunspot:solr:start

时,太阳黑子运行得很好

1 个答案:

答案 0 :(得分:6)

sunspot:solr:start任务将Solr分配到后台并立即退出。这与Foreman无法很好地结合,Foreman假设一个长期运行的前台进程。

你想要的是sunspot:solr:run,它将Solr放在前台,允许Foreman管理这个过程。

或者,如果我可能如此大胆,你也可以考虑cloud hosted Solr search,例如我自己的谦卑websolr.com