2

I am trying to install Solr4 latest and want to run it with Jetty (servlet container).

JAVA_HOME=/usr/lib/jvm/jre
JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr $JAVA_OPTIONS"
JETTY_HOME=/opt/solr
JETTY_USER=solr
JETTY_LOGS=/opt/solr/logs
JETTY_ARGS=/opt/solr/etc/jetty-plus.xml

I download jetty init script from LINK

I added it chkconfig. Issue which I facing is that when I start jetty it is not getting started. I followed the instructions provided on URL but nothing seems to be working.

netstat output

[root@localhost ~]# netstat -tlnp | grep 8983
[root@localhost ~]#

Nothing comes up in log file too I checked syslog as well as log defined in jetty too.

However when i run service jetty supervise it works and I can see the jetty is listening on port 8080. But its not getting started with init script.

Any clue what I have missed here, or let me know if any more infor is required from my end.

Aditional Info

java -version
java version "1.7.0_65"

cat /etc/issue
Amazon Linux AMI release 2014.03
Kernel \r on an \m

Solr 4.10 
jetty-distribution-9.2.3.v20140905

EDITED

set -x 
/etc/init.d/jetty restart
+ /etc/init.d/jetty restart
Stopping Jetty: OK
Starting Jetty: STARTED Jetty Thu Sep 18 18:07:27 UTC 2014
++ printf '\033]0;%s@%s:%s\007' root localhost '~'

2 Answers2

1

Changing to bash shell should work for you. It seems that you have messed with installation

Let me give you steps to do it which worked for me:

I downloaded solr4.10.1 .

cd /tmp
wget http://apache.arvixe.com/lucene/solr/4.10.1/solr-4.10.1.tgz
tar -xzf solr-4.10.1.tgz

As you have messed up the installation I would suggest to take backup if you want and delete /opt/solr and do the following

cp -rf /tmp/solr-4.10.1/example /opt/solr

Adduser solr if not added

useradd -d /opt/solr -s /sbin/false solr
chown solr:solr -R /opt/solr

From Apache link

NOTE: If you don't have start-stop-daemon tool you have to setup /bin/bash instead /sbin/false.

Create default jetty file as below :

JAVA_HOME=/usr/lib/jvm/jre
JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr/solr $JAVA_OPTIONS"
JETTY_HOME=/opt/solr
JETTY_USER=solr
JETTY_LOGS=/opt/solr/logs

NOTE: If you notice JAVA_OPTIONS in your default jetty file I have changed it to /opt/solr/solr do the same. Let other thing remain same.

Create /opt/solr/etc/jetty-logging.xml as Provided on link

Now download jetty 7 init script

wget https://raw.githubusercontent.com/eclipse/jetty.project/master/jetty-distribution/src/main/resources/bin/jetty.sh

cp jetty.sh /etc/init.d/jetty
chmod 755 /etc/init.d/jetty
chkconfig jetty on

So far we did single Solr installation with single core (collection1) , now start solr service and check if it is running and listening on default port

service jetty start

Go to your URL and http://IP:8983/solr and it should work fine for you.

Now we will go for Multicore setup

Move the folder /opt/solr/solr to /opt/solr/solr-bkp or delete it .

mv /opt/solr/solr /opt/solr/solr-bkp

Move the multicore folder as /opt/solr/solr

mv /opt/solr/multicore /opt/solr/solr

And you are done other details you can follow from the document SolrJetty

Hope this will help you.

Graeme
  • 660
  • 1
  • 5
  • 16
Pratap
  • 665
  • 6
  • 22
  • Thanks for detailed steps .. Let me try this as well and will get back to you. –  Oct 08 '14 at 15:35
0

Not sure if you've resolved this, but having gone through the same trouble, the fix for me was setting the shell for the solr user to /bin/bash instead of /bin/false.

Chuck
  • 1
  • No that did not work for me :( `grep solr /etc/passwd solr:x:501:502::/opt/solr:/bin/bash` –  Oct 02 '14 at 19:12