Community & Support

Apache Solr and cron on Media Temple dv

Hello everyone,
I have been trying to install Apache Solr module for the last couple of days. After searching on drupal.org and google. I have successfully installed Java and SolrPhpClient, and got the Apache Solr module up and running.

Reference links:
http://www.jaysonjc.com/2008/01/13/installing-java-16-jdk60-on-mediatemp...
http://drupal.org/node/343467

Now I have several questions regarding the apache solr module:

1.
The apache solr server switch itself off or disconnect from time to time for some reason that I don't know. I got "The Apache Solr search engine is not available. Please contact your site administrator." all the time. and I have to restart it manually from ssh. But after I ran java -jar start.jar, it didn't display the prompt([root@mydomain.com]#), I am using Terminal on Mac. And apache solr server disconnect when I quit Terminal.

2.
I can not set up the script to start apache solr server automatically by following the instructions in this node:
http://drupal.org/node/545368.
I successfully created the script and added it to the service. But when I tried to start solr by using "service solr start".
I get and error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
(I also post this question on that page)

3.
I understand I need to run cron in order to index the site. But I couldn't get it running after reading these posts:
http://drupal.org/node/205118
http://drupal.org/node/271617
I set up mine like so: 15 * * * * /usr/bin/lynx -source http://www.mydoamin.com/cron.php
I get email every 15 minuntes saying: 404 file not found, The requested URL mydomain.com/cron.php was not found on this server. But obviously it's there and the permission is right.

Thank you

Comments

RE: Apache Solr and cron on Media Temple dv

Tackling questions 1 and 2 first: these are swap space issues. When installing Solr on my personal (dv) Base account, I got the problem described in question 2. Installing on a client's (dv) Extreme account, however, produces the error in question 1: Solr starts and Drupal can connect to it, but the process hangs (at a line like "Created SocketConnector", I forget) and you have to ctrl-C to end the process, which stops Solr. Having said that, creating the startup script and restarting the server as described at the link in question 2 should start Solr just fine.

So, potential solutions for those two things:

1) Upgrade to a (dv) Extreme account. Upgrading to (dv) Rage may be enough, not sure, but I can confirm that Solr will run on (dv) Extreme servers as they're initially configured.

2) Turn off everything you're not using to free up memory. I don't know if this will work, haven't tried it on my own (dv) Base yet, but it's possible this might solve the problem. This is a tricky process and I can't advise you on exactly what to turn off, but for example, if you're not going to run your own nameservers, you should be able to turn off 'named'.

For your third question, I have cron setup on my (dv) accounts via Crontab in Plesk, and the command you want to use is:

curl --silent --compressed http://www.mydomain.com/cron.php

Hope that helps.

curl with media temple dv

I've had the hardest time figuring this out since I first started using drupal on media temple dv so I'm posting a message here. At first I used the php method, but curl seems a lot cleaner.

Instead of using domain name use ip address (if you have an exclusive ip)

Example:

curl --compressed --silent http://##.##.###.##/cron.php

Every ten minutes looks something like this:

*/10 * * * * curl --compressed --silent http://##.##.###.##/cron.php

replace ## with your servers ip address.