Installing Solr PHP via SSH cant install service

Installing Solr PHP via SSH cant install service

by alex mo -
Number of replies: 7

hey, 

im trying to install Solr PHP for Global Search via SSH

im using the lines provided by Moodle: https://docs.moodle.org/32/en/Global_search

but when im running this line: ./install_solr_service.sh solr-6.1.0.tgz

i keep getting an error:

The currently defined JAVA_HOME (/usr/local/jdk) refers

to a location where Java could not be found.  Aborting.

Either fix the JAVA_HOME variable or remove it from the

environment so that the system PATH will be searched.


but JAVA_HOME refers to: /opt/java/jdk1.8.0_45/


i cant find any solutio for this

Average of ratings: -
In reply to alex mo

Re: Installing Solr PHP via SSH cant install service

by Ken Task -
Picture of Particularly helpful Moodlers

Looks like Linux, so login as root user to server, then issue:

which java

Will show the path to the java your system knows about.

It might show /usr/bin/java

cd /usr/bin/

ls -l java

Think you'll see it's a symlink pointed to what might be an older version of java or the original java as your OS installed it ... many moons ago.

Simple fix is to remove the symlink in /usr/bin/ for java and then re-create it pointing to the newer version of java on your system.   Can't tell you the specific command but the newer java is probably in /opt/ somewhere.

'spirit of sharing', Ken


In reply to Ken Task

תשובה ל: Re: Installing Solr PHP via SSH cant install service

by alex mo -

thanks!

it worked, but now im stock in starting the service

im running: root@vps25583 [/opt/solr]#  bin/solr -force start -f

and i keep geting:

ERROR: start is not supported by this script



Usage: solr start [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a "additional-options"] [-V]


  -f            Start Solr in foreground; default starts Solr in the background

                  and sends stdout / stderr to solr-PORT-console.log


  -c or -cloud  Start Solr in SolrCloud mode; if -z not supplied, an embedded Zookeeper

                  instance is started on Solr port+1000, such as 9983 if Solr is bound to 8983


  -h <host>     Specify the hostname for this Solr instance


its shows the same when im trying to create a new core: 

 bin/solr create -c "Moodle"


In reply to alex mo

Re: תשובה ל: Re: Installing Solr PHP via SSH cant install service

by Ken Task -
Picture of Particularly helpful Moodlers

Am far from an expert in this so ... another guess.

Usage line shows not only command but options/switches to the command.

Compare usage to the command you issued.

bin/solr -force start -f

the -force option/startup swtich is before the actual command 'start'.

what if:

bin/solr start -f -force

'spirit of sharing', Ken


In reply to Ken Task

Re: תשובה ל: Re: Installing Solr PHP via SSH cant install service

by alex mo -

You are a genius!


it worked like a charm!


thank you!!!

In reply to alex mo

Re: תשובה ל: Re: Installing Solr PHP via SSH cant install service

by Ken Task -
Picture of Particularly helpful Moodlers

Glad it worked ... as to 'genius' ... thanks for the thought, but I probably know more about what doesn't work than what works!  My 'failure quotient' has a higher tolerance level than most ... actually, I never fail ... I discover what could be 5-10 ways that don't work. ;)

Feel free to rate postings that were helpful, as helpful. ;)

'spirit of sharing', Ken


In reply to Ken Task

Re: תשובה ל: Re: Installing Solr PHP via SSH cant install service

by alex mo -

i have just one last strange issue: 

after installing java and solr i mange to run the service, 

but after 10 min it stopped and also crashed the ssh client. 

when i'm re-entering the ssh there is no java and no solr install (the files are there but all configurations are gone)



In reply to alex mo

Re: תשובה ל: Re: Installing Solr PHP via SSH cant install service

by Ken Task -
Picture of Particularly helpful Moodlers

Re-read the docs for setup of the solr extension to apache.

Launching from the command line is a way to check/test the installation and functioning at first,, but it's only good for the life of the ssh session unless one leaves it running after exiting the ssh session with an & ... not recommended.

Apache/Moodle must be able to call solr from php scripts.

If you did get solr installed properly, did you restart the web server service and check to see that the solr mod/extension is indeed loading?

php -m |grep solr should show.

'spirit of sharing', Ken