Created
October 11, 2012 16:58
-
-
Save leedavis81/3873877 to your computer and use it in GitHub Desktop.
Create a new core
This file contains 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/bash | |
# creates a new Solr core | |
if [ "$1" = "" ]; then | |
echo -n "Name of core to create: " | |
read name | |
else | |
name=$1 | |
fi | |
mkdir -p /var/lib/solr/data/$name | |
chown tomcat6.tomcat6 /var/lib/solr/data/$name | |
mkdir -p /etc/solr/conf/$name/conf | |
cp -a /etc/solr/conftemplate/* /etc/solr/conf/$name/conf/ | |
sed -i "s/CORENAME/$name/" /etc/solr/conf/$name/conf/solrconfig.xml | |
curl "http://127.0.0.1:8080/solr/admin/cores?action=CREATE&name=$name&instanceDir=/etc/solr/conf/$name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment