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?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:31:36
Script start
Timing: Jan 18 2025 10:31:36
Module start 'layout'
Timing: Jan 18 2025 10:31:36
Module start 'content'
Timing: Jan 18 2025 10:31:37
Module end 'content'
Timing: Jan 18 2025 10:31:37
Script end

Main resources:

Total runtime1.0214 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.1953152.6406
Module start 'layout' 0.00710.0286 741.835939.4766
Module start 'content' 0.03570.9843 781.3125630.0000
Module end 'content' 1.02000.0014 1,411.312516.1328
Script end 1.0214  1,427.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3591160.0002
Check MTime0.00160.1581160.0001
Mysql Total
Database connection0.00090.092310.0009
Mysqli_queries0.952693.2589730.0130
Looping result0.00070.0732710.0000
Template Total0.956793.720.4784
Template load0.00210.207920.0011
Template processing0.954693.452520.4773
Template load and register function0.00010.010510.0001
states
state_id_array0.00200.194910.0020
state_identifier_array0.00090.087620.0004
Override
Cache load0.00180.1789400.0000
Sytem overhead
Fetch class attribute can translate value0.00080.080430.0003
Fetch class attribute name0.00130.127390.0001
XML
Image XML parsing0.00120.113230.0004
class_abstraction
Instantiating content class attribute0.00000.0026110.0000
General
dbfile0.00120.1154230.0001
String conversion0.00010.012740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs