tags:

views:

55

answers:

3

I follow the instruction on http://lucene.apache.org/solr/tutorial.html and I can setup Solr on my PC.

Now when I come to my VPS I cannot overcome the step: $ java -jar start.jar

Afer running that command, search service is available at http: //x.x.x.x:8983/solr/select .

But, Whenever I close the SSH client, the service on http: //x.x.x.x:8983/solr/select is also closed. So I can't search any more.

What should I do?


My VPS has 512MB RAM and run mainly lighttpd, php and mySQL. Do you think Solr is suitable for me, or Sphinx is a better choice? I need faceted search on my site.

Thanks for any help.

A: 

I think you challenge is that when you start up Solr, you are starting it up as a console process, not as a daemon. So when you log out, it kills the Java process! There are a number of ways around this, from using a tool like "screen" to preserve your running console processes when you log out, to using commands like nohup or java -jar start.jar & to send those processes to the background.

However, what you really need to do is install Tomcat or Jetty as a daemon service on your VPS. You may be able to have your VPS hosting provider do this for you.

As far as your hardware setup, I think unless you have a ginormous index, or really busy site, 512 of RAM should be plenty to run a LAMP style website and Solr. One nice thing about Solr being HTTP based is you can quickly move your Solr server to another VPS as your load increases!

I would contact your VPS provider and ask them if Java is supported/recommended.. If so, you are good to go, if not, then you need a good Java supporting VPS!

Eric Pugh
A: 

I would recommend running Solr with Tomcat. That way you can run multipe Solr configurations with ease.

You can control your Solr installation from the Tomcat manager (stopping/starting).

To store Tomcat logging under your Solr directory check: http://globalgateway.wordpress.com/2010/01/06/configuring-solr-1-4-logging-with-log4j-in-tomcat/

Jem
A: 

Thank you very much. I decided to use Jetty as a daemon service to serve Solr because of its lightweight and ease to embed. It works very well on my VPS (althought this daemon use too much RAM - 50%).

My VPS is clean I and I can setup Java without any problem.