Forums / Extensions / eZ Find / Install solr as service (init script)

Install solr as service (init script)

Author Message

Martin Bergmeyer

Tuesday 14 July 2009 2:59:12 am

Hi,

I am using Red Hat Enterprise Linux 4. I tried the init script which is delivered with ezfind 2.0, but it is not working.

I followed the instructions in the solr file and edited the path to solr and java in this file.
When I tried to start the script I got no error message. But the server is not running.

Is there anything I still have to customize? Any other idea where I have to look?

Thanks in advance for answers.

Steven E. Bailey

Tuesday 14 July 2009 3:55:22 am

Make sure that the shell script the init script calls is executable: extension/ezfind/java/solr.sh otherwise it will not work. Also try running that shell script from the command line to see if it displays any errors.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Martin Bergmeyer

Tuesday 14 July 2009 4:17:43 am

Thanks for your answer.

The shell script solr.sh is executable. When I run the script, it gives me the error message that the JAVA_HOME environment is not set. When I added the JAVA_HOME variable to the script, then the script is wokring. The server starts.

I looked into the solr init script again, but I could not see any call to the solr.sh file.

Any other ideas?

Steven E. Bailey

Tuesday 14 July 2009 4:40:19 am

Huh, well, I've never looked at the red hat script, it is different from the debian script and yeah I don't see where solr.sh is defined anywhere either. In the debian script it would be this line:

DAEMON=$SOLR_HOME/$NAME.sh

Have you tried running the init script with shell debugging i.e.
sh -x /etc/init.d/solr start
maybe that will help narrow the problem down.

Are you sure your script is the correct script for the version of ezfind you are running?

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Steven E. Bailey

Tuesday 14 July 2009 4:49:41 am

Looks like solr.sh is only for debian... the line in the redhat script that should start it is:

daemon --check $NAME --pidfile /var/run/solr.pid nohup java -jar start.jar > /dev/null 2>&1 &

Could be possible that java is not in root's $PATH or something like that.

You might want to temporarily remove the > /dev/null 2>&1 to see if there is an error that's being suppressed.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Gaetano Giunta

Tuesday 14 July 2009 8:04:01 am

NB: there's a small bug in the version of that script delivered with ezfind 2.0. It should be

daemon --check $NAME --pidfile /var/run/solr.pid nohup $JAVA -jar start.jar > /dev/null 2>&1 &

notice the usage of $JAVA instead of "java" when starting the server

Principal Consultant International Business
Member of the Community Project Board

Martin Bergmeyer

Thursday 16 July 2009 6:49:11 am

Thanks for your help. But I could not solve the problem until now.

It looks like that the row with the daemon call ist not working. I got a return value of zero, what is normaly OK. But there is no java in the process list and the solr pid file is empty.

Is there anything else I can try?