diff --git a/conf/vagrant/etc/init.d/solr b/conf/vagrant/etc/init.d/solr deleted file mode 100755 index a5de033dae8..00000000000 --- a/conf/vagrant/etc/init.d/solr +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# Starts, stops, and restarts Apache Solr. -# -# chkconfig: 35 92 08 -# description: Starts and stops Apache Solr - -SOLR_DIR="/usr/local/solr/solr-7.2.1" -SOLR_COMMAND="bin/solr" -SOLR_ARGS="-m 1g" -SOLR_USER=solr - -case $1 in - start) - echo "Starting Solr" - cd $SOLR_DIR - sudo -u $SOLR_USER $SOLR_COMMAND start $SOLR_ARGS - ;; - stop) - echo "Stopping Solr" - cd $SOLR_DIR - sudo -u $SOLR_USER $SOLR_COMMAND stop $SOLR_ARGS - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - *) - echo "Usage: $0 {start|stop|restart}" >&2 - exit 1 - ;; -esac - diff --git a/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr b/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr index 853a272493a..a5de033dae8 100755 --- a/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr +++ b/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr @@ -1,4 +1,3 @@ -**** #!/bin/sh # Starts, stops, and restarts Apache Solr. @@ -6,20 +5,21 @@ # chkconfig: 35 92 08 # description: Starts and stops Apache Solr -SOLR_DIR="/usr/local/solr-7.2.1" +SOLR_DIR="/usr/local/solr/solr-7.2.1" SOLR_COMMAND="bin/solr" SOLR_ARGS="-m 1g" +SOLR_USER=solr case $1 in start) echo "Starting Solr" cd $SOLR_DIR - $SOLR_COMMAND start $SOLR_ARGS + sudo -u $SOLR_USER $SOLR_COMMAND start $SOLR_ARGS ;; stop) echo "Stopping Solr" cd $SOLR_DIR - $SOLR_COMMAND stop $SOLR_ARGS + sudo -u $SOLR_USER $SOLR_COMMAND stop $SOLR_ARGS ;; restart) $0 stop diff --git a/doc/sphinx-guides/source/_static/installation/files/etc/systemd/solr.service b/doc/sphinx-guides/source/_static/installation/files/etc/systemd/solr.service index 80d82a2c3c4..a1124e9202f 100644 --- a/doc/sphinx-guides/source/_static/installation/files/etc/systemd/solr.service +++ b/doc/sphinx-guides/source/_static/installation/files/etc/systemd/solr.service @@ -5,8 +5,8 @@ After = syslog.target network.target remote-fs.target nss-lookup.target [Service] User = solr Type = simple -WorkingDirectory = /usr/local/solr-7.2.1 -ExecStart = bin/solr start -m 1g +WorkingDirectory = /usr/local/solr/solr-7.2.1 +ExecStart = /usr/local/solr/solr-7.2.1/bin/solr start -m 1g Restart=on-failure [Install] diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 020ff171301..b606b8d70d6 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -4,7 +4,7 @@ Configuration Now that you've successfully logged into Dataverse with a superuser account after going through a basic :doc:`installation-main`, you'll need to secure and configure your installation. -Settings within Dataverse itself are managed via JVM options or by manipulating values in the ``setting`` table directly or through API calls. Configuring Solr requires manipulating XML files. +Settings within Dataverse itself are managed via JVM options or by manipulating values in the ``setting`` table directly or through API calls. Once you have finished securing and configuring your Dataverse installation, you may proceed to the :doc:`/admin/index` for more information on the ongoing administration of a Dataverse installation. Advanced configuration topics are covered in the :doc:`r-rapache-tworavens`, :doc:`shibboleth` and :doc:`oauth2` sections. @@ -63,25 +63,6 @@ Password complexity rules for "builtin" accounts can be adjusted with a variety - :ref:`:PVGoodStrength` - :ref:`:PVCustomPasswordResetAlertMessage` -Solr ----- - -schema.xml -++++++++++ - -The :doc:`prerequisites` section explained that Dataverse requires specific Solr schema and config files called ``schema.xml`` and ``solrconfig.xml`` respectively, that can be found in the Dataverse distribution. You should have already replaced the default ``example/solr/collection1/conf/schema.xml`` and ``example/solr/collection1/conf/solrconfig.xml`` file that ships with Solr. - -jetty.xml -+++++++++ - -Stop Solr and edit ``solr-7.2.1/server/etc/jetty.xml`` , changing ``requestHeaderSize`` as follows: - -.. code-block:: xml - - - -Without this ``requestHeaderSize`` line in place, which increases the default size, it will appear that no data has been added to your Dataverse installation and ``WARN org.eclipse.jetty.http.HttpParser – HttpParser Full for /127.0.0.1:8983`` will appear in the Solr log. See also https://support.lucidworks.com/hc/en-us/articles/201424796-Error-when-submitting-large-query-strings- - Network Ports ------------- diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst index e8a84db5a24..492e57439a6 100644 --- a/doc/sphinx-guides/source/installation/prerequisites.rst +++ b/doc/sphinx-guides/source/installation/prerequisites.rst @@ -166,49 +166,56 @@ The Dataverse search index is powered by Solr. Installing Solr =============== -Download and install Solr with these commands:: +You should not run Solr as root. Create a user called ``solr`` and a directory to install Solr into:: - # wget https://archive.apache.org/dist/lucene/solr/7.2.1/solr-7.2.1.tgz - # tar xvzf solr-7.2.1.tgz - # rsync -auv solr-7.2.1 /usr/local/ - # cd /usr/local/solr-7.2.1/server/solr - # cp -r configsets\_default . - # mv _default collection1 - # cd collection1/conf - # cp -a solrconfig.xml solrconfig.xml.orig + useradd solr + mkdir /usr/local/solr + chown solr:solr /usr/local/solr -Dataverse requires a custom Solr configuration and schema to operate and are contained in the "dvinstall.zip" file in each Dataverse release at https://github.com/IQSS/dataverse/releases . Download this zip file, extract ``schema.xml`` & ``solrconfig.xml`` from it, and put it into place (in the same directory as above):: +Become the ``solr`` user and then download and configure Solr:: - # cp /tmp/schema.xml schema.xml - # cp /tmp/solrconfig.xml solrconfig.xml + su - solr + cd /usr/local/solr + wget https://archive.apache.org/dist/lucene/solr/7.2.1/solr-7.2.1.tgz + tar xvzf solr-7.2.1.tgz + cd solr-7.2.1 + cp -r server/solr/configsets/_default server/solr/collection1 -Note: Dataverse has customized Solr to boost results that come from certain indexed elements inside Dataverse, for example results matching on the name of a dataset. If you would like to remove this, edit your solrconfig.xml and remove the ```` element and its contents. +Download "dvinstall.zip" file in each Dataverse release at https://github.com/IQSS/dataverse/releases and unzip it into ``/tmp``. Then copy the files into place:: -With the Dataverse-specific schema in place, you can now start Solr and create the core that will be used to manage search information:: + cp /tmp/dvinstall/schema.xml /usr/local/solr/solr-7.2.1/server/solr/collection1/conf + cp /tmp/dvinstall/solrconfig.xml /usr/local/solr/solr-7.2.1/server/solr/collection1/conf - # cd /usr/local/solr-7.2.1 - # bin/solr start - # bin/solr create_core -c collection1 -d server/solr/collection1/conf/ +Note: Dataverse has customized Solr to boost results that come from certain indexed elements inside Dataverse, for example results matching on the name of a dataset. If you would like to remove this, edit your ``solrconfig.xml`` and remove the ```` element and its contents. +Dataverse requires a change to the ``jetty.xml`` file that ships with Solr. Edit ``/usr/local/solr/solr-7.2.1/server/etc/jetty.xml`` , increasing ``requestHeaderSize`` from ``8192`` to ``102400`` +With the Dataverse-specific config in place, you can now start Solr and create the core that will be used to manage search information:: + + cd /usr/local/solr/solr-7.2.1 + bin/solr start + bin/solr create_core -c collection1 -d server/solr/collection1/conf/ Solr Init Script ================ -The command above will start Solr which is good for a quick sanity check that Solr accepted the schema file, but letting the system start Solr automatically is recommended. - -- This :download:`Solr Systemd file<../_static/installation/files/etc/systemd/solr.service>` will launch Solr on boot as the solr user for RHEL/CentOS 7 or Ubuntu 16+ systems, or -- For systems using init.d, you may attempt to adjust this :download:`Solr init script <../_static/installation/files/etc/init.d/solr>` for your needs or write your own. +For systems running systemd, as root, download :download:`solr.service<../_static/installation/files/etc/systemd/solr.service>` and place it in ``/tmp``. Then start Solr and configure it to start at boot with the following commands:: + + cp /tmp/solr.service /usr/lib/systemd/system + systemctl start solr.service + systemctl enable solr.service -Solr should be running before the Dataverse installation script is executed. +For systems using init.d, :download:`Solr init script <../_static/installation/files/etc/init.d/solr>` and place it in ``/tmp/``. Then start Solr and configure it to start at boot with the following commands:: + + cp /tmp/solr /etc/init.d + service solr start + chkconfig solr on Securing Solr ============= Solr must be firewalled off from all hosts except the server(s) running Dataverse. Otherwise, any host that can reach the Solr port (8983 by default) can add or delete data, search unpublished data, and even reconfigure Solr. For more information, please see https://lucene.apache.org/solr/guide/7_2/securing-solr.html -You may want to poke a temporary hole in your firewall to play with the Solr GUI. More information on this can be found in the :doc:`/developers/dev-environment` section of the Developer Guide. - jq -- diff --git a/scripts/vagrant/setup-solr.sh b/scripts/vagrant/setup-solr.sh index eabead41721..8cf393fc087 100755 --- a/scripts/vagrant/setup-solr.sh +++ b/scripts/vagrant/setup-solr.sh @@ -10,7 +10,7 @@ su $SOLR_USER -s /bin/sh -c "cd $SOLR_HOME/solr-7.2.1/server/solr && cp -r confi su $SOLR_USER -s /bin/sh -c "cp /conf/solr/7.2.1/schema.xml $SOLR_HOME/solr-7.2.1/server/solr/collection1/conf/schema.xml" su $SOLR_USER -s /bin/sh -c "cp /conf/solr/7.2.1/solrconfig.xml $SOLR_HOME/solr-7.2.1/server/solr/collection1/conf/solrconfig.xml" su $SOLR_USER -s /bin/sh -c "cd $SOLR_HOME/solr-7.2.1 && bin/solr start && bin/solr create_core -c collection1 -d server/solr/collection1/conf/" -cp /dataverse/conf/vagrant/etc/init.d/solr /etc/init.d/solr +cp /dataverse/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr /etc/init.d/solr chmod 755 /etc/init.d/solr /etc/init.d/solr stop /etc/init.d/solr start