-
-
Notifications
You must be signed in to change notification settings - Fork 644
Solr post-provision script only works for 5.x and later #1518
Comments
@danepowell - So, welcome to my Solr hell. I'm currently supporting Solr 1.4 (!!), 3.5, 4.10.4, 5.x and 6.x across various projects :D Please check out https://hub.docker.com/r/geerlingguy/solr/ for some more docs concerning core creation and placement in 4.x and 3.x. Note that in 4.x, there's no convenient helper functionality built into solr to generate cores. Instead, you have to either copy the default core that's installed with solr to the directory where you want your cores (usually |
I'm debating whether to close this as a won't fix though... I'd consider 4.x releases to be legacy/un-officially-supported now, as they have not had bugfix or even critical security support for months (years maybe?), and I've already spent an ungodly number of my own hours trying to fix things for Solr < 4... See: http://lucene.apache.org/solr/community.html#about-versions
|
I totally get it, even if the script can't be easily updated to support multiple versions, maybe we could just add a note that it only works for 5.x+ and link to this issue? |
Sounds good! |
For posterity, here's the setup script I used for a 4.x core: SOLR_CORE_NAME="collection1"
SOLR_SETUP_COMPLETE_FILE="/etc/drupal_vm_solr_config_complete_$SOLR_CORE_NAME"
SOLR_CORE_PATH="/var/solr/$SOLR_CORE_NAME"
# Check to see if we've already performed this setup.
if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then
# Copy new Solr collection core with the Solr configuration provided by module.
sudo cp -r /var/www/foo/box/config-dir/* $SOLR_CORE_PATH/conf/
# Adjust the autoCommit time so index changes are committed in 1s.
sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' $SOLR_CORE_PATH/conf/solrconfig.xml
# Restart Apache Solr.
sudo service solr restart
# Create a file to indicate this script has already run.
sudo touch $SOLR_SETUP_COMPLETE_FILE
else
exit 0
fi |
Note that for later version of Ubuntu, you have to update the script I posted above as in acquia/blt#2841 Otherwise Solr won't start, because 4.5.1 is incompatible with systemd |
The example solr post-provision script includes this command:
/opt/solr/bin/solr
This only works on Solr 5.x. On Solr 4.x, that binary doesn't exist and the command fails. I haven't been able to figure out what the equivalent command is on 4.x, or whether it even exists.
The text was updated successfully, but these errors were encountered: