1

I am trying to install apache solr and I am following this tutorial. The problem is when I am trying to run bin/install_solr_service.sh --strip-components=2 it tells that

Supported OPTIONS include:

-d     Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr

-i     Directory to extract the Solr installation archive; defaults to /opt/
         The specified path must exist prior to using this script.

-p     Port Solr should bind to; default is 8983

-s     Service name; defaults to solr

-u     User to own the Solr files and run the Solr process as; defaults to solr
         This script will create the specified user account if it does not exist.

-f     Upgrade Solr. Overwrite symlink and init script of previous installation. 
NOTE: Must be run as the root user

Why is it showing this error when I am already running it as root? Please help me out. Thanks in advance.

This is the output for ls -lh /opt:

total 38M

drwxrwxrwx 7 root root 4.0K Apr 29 09:48 android-studio
drwxr-xr-x 2 root root 4.0K Jun  2 20:35 bin
drwxr-xr-x 3 root root 4.0K Nov 18  2015 google
drwxr-xr-x 5 root root 4.0K Jun  3 12:21 solr-5.5.1
drwxr-xr-x 5 root root 4.0K Jun  2 20:43 solr-6.0.1
-rw-r--r-- 1 root root  38M Jun  2 20:28 solr-6.0.1-src.tgz
drwxr-xr-x 4 root root 4.0K May 16 14:54 sublime_text
drwxr-xr-x 4 root root 4.0K May 16 11:30 teamviewer
2
  • Do you still have this issue?
    – Elder Geek
    Sep 18, 2017 at 13:54
  • Please do not change the name of the tgz file after download. The install script (miss?)uses the name for checking ;-) (see the install script especially extracting part) Oct 10, 2020 at 13:44

3 Answers 3

1

Being the root user is not the problem.

It looks like the tutorial contains a mistake. The --strip-components part of the command is actually part of the tar command found in the previous step.

The error message you're receiving is actually telling you that the option you're entering isn't one of the supported options in the list. The part about being the root user is just a note.

When compared to the tutorial found here you'll see that --strip-components is used in the unpacking of the .tar file.

3
  • When I ran : sudo bash ./install_solr_service.sh solr-5.5.1-src.tgz it throws out another error, Extracting solr-5.5.1-src.tgz to /opt ERROR: Expected directory /opt/solr-5.5.1-src not found after extracting solr-5.5.1-src.tgz ... script fails. Am I supposed to run this in /opt? I even tried installing in /opt , there again it throws the same error. What is happening @Arronical?
    – Horcrux
    Jun 3, 2016 at 6:53
  • I've not installed solr myself so not entirely sure. Could you edit your question to include the output of ls -lh /opt please.
    – Arronical
    Jun 3, 2016 at 8:18
  • I edited my question
    – Horcrux
    Jun 4, 2016 at 7:33
1
  1. Go to /tmp directory

    cd /tmp
    
  2. check the website for updated version and type wget url_path_to_the_zip_file

    wget http://www.us.apache.org/dist/lucene/solr/6.6.1/solr-6.6.1-src.tgz
    
  3. Extract the archive contents

    tar xzf solr_zip_name path to install_solr_service.sh --strip-components=2 
    tar xzf solr-6.6.1-src.tgz solr-6.6.1/solr/bin/install_solr_service.sh --strip-components=2
    
  4. Run the install script

    sudo ./install_solr_service.sh solr-6.0.1.tgz
    

you can follow some steps from this guide on GitHub

1

Download solr zip file from http://www-eu.apache.org/dist/lucene/solr/6.6.1/

Unzip the file

Open command prompt and go to the Solr folder and start solr

bin/solr start -e cloud -noprompt

Open your browser and open the link: http://localhost:8983/solr/#/

1
  • OMFG THANK YOU! This was ruining my day until I found this answer! Dec 17, 2020 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .