Create Solr Startup Files
To create the necessary Solr startup files:
-
Create a Solr core folder and
core.properties
file as follows:#
mkdir -p /var/lib/escenic/solr/solr-core#
cat > /var/lib/escenic/solr/solr-core/core.properties <<EOF name=solr-core config=solrconfig.xml schema=schema.xml dataDir=data EOFwhere solr-core is the name of your Solr core. Typically you might choose to use either
editorial
orpresentation
as the name of your core depending on its purpose (that is, what kind of host you are installing it on). -
Change ownership of the Solr folder and all its contents, so that it can be used by the
escenic
user:#
chown -R escenic:escenic /var/lib/escenic/solr -
Create a configuration file for the
/opt/solr/bin/solr
startup script. Do this by moving (not copying) the file as follows:#
mv /opt/solr/bin/solr.in.sh /etc/default/ -
Append settings for
SOLR_HOME
,SOLR_LOGS_DIR
andSOLR_PID_DIR
to the moved script as shown below:#
cat >> /etc/default/solr.in.sh <<EOF SOLR_HOME=/var/lib/escenic SOLR_LOGS_DIR=/var/log/escenic SOLR_PID_DIR=/var/run/escenic EOFThis will ensure that Solr looks for the core in the right place (where you created it in step 1) and writes log files and runtime files to the same locations as corresponding Content Store files.
-
Make sure that all the folders you specified in step 4 actually exist and that the
escenic
user is either the owner or has read/write permissions. -
Add an
init.d
script for starting Solr automatically on boot:#
cp /opt/solr/bin/init.d/solr /etc/init.d/#
sed -i "s#RUNAS=\"solr\"#RUNAS=\"escenic\"#" /etc/init.d/solr -
Add the
init.d
script to the desired run levels. For Debian- and Ubuntu-based systems, you can do this as follows:#
update-rc.d solr defaults 35For other systems, please consult the appropriate documentation.