The following instructions are derived from the official Solr installation documentation: https://solr.apache.org/guide/8_11/taking-solr-to-production.html
Use whatever method your OS requires.
sudo adduser solr
This runs the automatic Solr installer.
This will install Solr at /opt/solr
and SOLR_HOME at /var/solr
, and will install Solr as a systemd service.
cd /opt
sudo wget https://archive.apache.org/dist/lucene/solr/8.11.2/solr-8.11.2.tgz
sudo tar xzf solr-8.11.2.tgz solr-8.11.2/bin/install_solr_service.sh --strip-components=2
sudo ./install_solr_service.sh solr-8.11.2.tgz -i /opt -d /var/solr -u solr -s solr -p 8983
The automatic installation is preferred. The following steps may be incomplete. See the Solr documentation for full installation options and details.
cd /opt
sudo wget https://archive.apache.org/dist/lucene/solr/8.11.2/solr-8.11.2.zip
sudo unzip solr-8.11.2.zip
sudo rm solr-8.11.2.zip
sudo ln -s /opt/solr-8.11.2 /opt/solr
You will likely need to add these environmental variables to the solr user's .bashrc
or .bash_profile
.
SOLR_PID_DIR=/var/solr
SOLR_HOME=/var/solr/data
Note |
---|
Replace staff in solr:staff with the appropriate group account, or leave the entire string as solr |
sudo chown -R solr:staff /opt/solr*
sudo chmod -R g+rw /opt/solr*
sudo vi /etc/systemd/system/solr.service
Copy the following text.
[Unit]
Description=Apache SOLR
[Service]
Type=forking
User=solr
Environment=SOLR_INCLUDE=/opt/solr/bin/solr.in.sh
ExecStart=/opt/solr/bin/solr start
ExecStop=/opt/solr/bin/solr stop
Restart=on-failure
LimitNOFILE=65000
LimitNPROC=65000
TimeoutSec=180s
[Install]
WantedBy=multi-user.target
Then activate the new service.
sudo systemctl daemon-reload
sudo systemctl enable solr
sudo systemctl start solr
Note |
---|
Replace /apps/archivesspace/solr/ with the location of your ASpace instance |
sudo mkdir -p /opt/solr-8.11.2/server/solr/configsets/archivesspace/conf
sudo cp -a /apps/archivesspace/solr/* /opt/solr-8.11.2/server/solr/configsets/archivesspace/conf
Restart Solr as systemd service.
sudo systemctl restart solr
or
sudo su - solr
cd /opt/solr
bin/solr stop
bin/solr start
sudo su - solr
cd /opt/solr
bin/solr create -c archivesspace -d archivesspace