Last active
September 18, 2016 18:18
-
-
Save softwaredoug/097dfbc8f2fabe0b85009471213a2bac to your computer and use it in GitHub Desktop.
Shell script for creating sandbox solr collections for playing/experimentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Silly shell script for creating test/sandbox solr collections for | |
# quick experimentation | |
# | |
# Setup | |
# 1. git clone <lucene-solr repo> | |
# 2. Place this script in the git root directory | |
# 3. Change DUMMY_SOLR_HOME below where you want to create toy collections | |
# | |
# Usage | |
# 1. Run ./dummySolr.sh coll_name, which bootstraps a new collection | |
# 2. Run Solr pointing to dummy_solr | |
# | |
# cd solr/ | |
# ./bin/solr start -s "<DUMMY_SOLR_HOME>" | |
# | |
# | |
# Where you want your solr config to go | |
DUMMY_SOLR_HOME=~/ws/dummy_solr_541 | |
if [ $# -eq 0 ]; then | |
echo "Usage ./dummySolr.sh <collname>" | |
echo "No arguments provided" | |
exit 1 | |
fi | |
if [ ! -d "$DUMMY_SOLR_HOME" ]; then | |
mkdir $DUMMY_SOLR_HOME | |
cp solr/server/solr/solr.xml "$DUMMY_SOLR_HOME" | |
cp solr/server/solr/zoo.cfg "$DUMMY_SOLR_HOME" | |
cp ./dummySolrCloud.sh "$DUMMY_SOLR_HOME" | |
fi | |
mkdir -p "$DUMMY_SOLR_HOME/$1/conf" | |
cp -R solr/server/solr/configsets/basic_configs/conf/* "$DUMMY_SOLR_HOME/$1/conf" | |
echo "name=$1" > "$DUMMY_SOLR_HOME/$1/core.properties" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment