ruby-on-railsherokusolrwebsolr

Can't stop solr server on Heroku


I try to stop solr server on Heroku (already have the Websolr $20 addon installed) but I'm not being able to do so.

$ heroku run rake sunspot:solr:stop
Running `rake sunspot:solr:stop` attached to terminal... up, run.1
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
rake aborted!
No PID file at /app/solr/pids/production/sunspot-solr-production.pid

Tasks: TOP => sunspot:solr:stop
(See full trace by running task with --trace)

Any idea why is this happening?


Solution

  • When you say heroku run, you're asking Heroku to spin up a new dyno. You're then telling this new dyno to run a rake task to stop Solr -- but it's not running Solr, it's a brand new dyno on a totally different server, and it's only running the rake task to stop Solr.

    You only have a few ways to communicate with a dyno once it's launched:

    You can get a list of the processes your application is running via heroku ps. (Presumably this list will include the Solr instance you're trying to stop.) You can terminate any of these processes with heroku ps:stop <process name>.