Error in Starting Solr whilw Installting Dspace 7 on Ubuntu 22.04

203 views
Skip to first unread message

Nadeem Sohail

unread,
Nov 26, 2022, 1:16:30 AM11/26/22
to DSpace Technical Support
Dear All Friends,
I am installing Dspace 7 on cloud server Ubuntu 22.04. I am facing a problem to starting solr:
when I run the command : 
root@repository:~# cd /opt
root@repository:/opt# su dspace
$ /opt/solr/bin/solr start
The currently defined JAVA_HOME (”/usr/lib/jvm/java-11-openjdk-amd64”) 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.

While I am following the instruction as:

Solr Installation

Solr is an open-source search platform, written in Java. Its major features include full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, database integration, NoSQL features, and rich document handling.

Download the Solr software package from the website and save it to the opt folder in the operating system. 

Enter into the /opt folder.

cd /opt

Download the Solr (version 8) package using the following command line,

sudo wget https://www.apache.org/dyn/closer.lua/lucene/solr/8.11.1/solr-8.11.1.zip?action=download

Rename the Zip file,

sudo mv solr-8.11.1.zip\?action\=download solr-8.11.1.zip

Unzip the package,

sudo unzip solr-8.11.1.zip

Rename Solr directory

sudo mv solr-8.11.1 solr

Downloaded Solr ZIP files not required, delete it,

sudo rm solr-8.11.1.zip

Apply the following command to check Solr directory available at /opt

ls

Change the folder permission to Dspace user,

sudo chown -R dspace:dspace solr

Check whether the folder permission changed or not.

ls -la

Login to the dspace user account to start Solr.

su dspace

Start Solr by applying the command,

/opt/solr/bin/solr start

Please may anyone guide me how to reslove this error?

With kindest regards,
............................................
Nadeem Sohail
Head
Learning Resource Center (LRC)
University of Management &Technology, Sialkot Campus
Office Ph: +92 523575234-6 Ext. 118



Mohammad S. AlMutairi

unread,
Nov 26, 2022, 12:47:25 PM11/26/22
to DSpace Technical Support
Hello Nadeems,

Some tutorials you find on the net are total mess. It will make things more complicated instead of making simpler and easier. You need to go back and remove Java and Solr and start over by following the steps you see below in the sequence you see them.

####################### Java OpenJDK 11 Installation #######################
1) apt install default-jdk -y
2) java -version
3) echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/" >> /etc/environment
4) export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
####################### End of Java OpenJDK 11 installation #######################

####################### Apache Maven and Ant Installation #######################
1) apt install maven ant ant-optional -y
2) mvn -v
3) ant -version
################### End of Apache Maven and Ant installation ####################

####################### Solr 8.11.1 Installation #######################
1) mkdir /build
2) cd /build
3) apt install lsof -y
4) wget https://downloads.apache.org/lucene/solr/8.11.2/solr-8.11.2.tgz
5) tar xzf solr-8.11.2.tgz solr-8.11.2/bin/install_solr_service.sh --strip-components=2
6) bash ./install_solr_service.sh solr-8.11.2.tgz -f
7) cp -r /opt/dspace/solr/* /var/solr/data/ # Do this step after installing dspace backend (REST API server). You need to change /opt/dspace to the folder you installed dspace backend into.
8) chown -R solr:solr /var/solr/data/
9) systemctl enable solr
10) systemctl restart solr
####################### End of Solr 8.11.1 installation #######################

Good luck

Mohammad S. AlMutairi

unread,
Dec 2, 2022, 10:50:12 PM12/2/22
to DSpace Technical Support
2022-12-03_6-45-04.jpg
Reply all
Reply to author
Forward
0 new messages