Closed (fixed)
Project:
Apache Solr Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2009 at 23:13 UTC
Updated:
5 Nov 2012 at 14:17 UTC
i've installed per the readme file, but i've noticed something strange. I run java -jar start.jar using SSH and it loads and solr runs fine. I go to the solr admin page and am able to connect to solr fine.
BUT, then i close the window of the SSH and close the session, solr becomes unavailable! How do i keep it running all the time?
thanks.
Comments
Comment #1
janusman commentedYou need to run Solr in the background properly. I achieve that with this command:
This outputs a process number to the terminal; you should store it for future reference so you can later kill that process if you need to =)
Please tell me if this worked for you.
Comment #2
akolahi commentedperfecto! THANKS!
Comment #3
akolahi commentedhmmm well it worked okay for a day... but i got the "Your site was unable to contact the Apache Solr server." error this morning. I will try again.
Is this supposed to be run from the example folder i.e. */solr-tomcat/apache-solr-nightly/example?
Thanks.
Comment #4
JacobSingh commentedYou should get support from solr-user@ mailing list for things directly related to running Solr.
Comment #5
kdes commented@janusman
I ran the command "nohup java -jar start.jar >logfile 2>&1 &" and solr seems to be working fine even after I close SSH. But, where do I look for the process number ? It didn't output anything in my SSH window.
Comment #6
janusman commentedYou can get the number of the last-run background process, from within a shell, with $!
For example, if you have this shell script: (you can paste this code into a file like run_solr.sh)
You could then invoke this script from within the shell with "sh run_solr.sh" or the like.
You could add more bells and whistles like checking for errors (using $?) or killing an existing process (cat pid |xargs kill -9) etc.
It would probably be nice to have a full script for this in the future for everyone using the /example directory bundled with Solr. If there is real interest I could whip up one =)
Comment #7
janusman commentedOh NTW I also came across this way to do it in PHP; probably *could* be a good thing to include some code to run a local Solr install from within Drupal?
http://bogdan.org.ua/2007/05/23/executing-and-checking-background-shell-...
Comment #8
Aurochs commentedfuf i hope it wont get off here - i had same problem.
is there any way to write it into some confirm file inside apachesolr?
Comment #9
raulmuroc commentedThe same solution.