fixed create/remove scripts
This commit is contained in:
19
setenv.sh
Normal file → Executable file
19
setenv.sh
Normal file → Executable file
@@ -1,34 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -z "$SOLR_HOST" ]]; then
|
||||
if [[ -z "$SOLR_HOST" ]]; then
|
||||
echo "A SOLR_HOST environment variable is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_PORT" ]]; then
|
||||
if [[ -z "$SOLR_PORT" ]]; then
|
||||
SOLR_PORT=8983
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_PROTOCOL" ]]; then
|
||||
if [[ -z "$SOLR_PROTOCOL" ]]; then
|
||||
SOLR_PROTOCOL=http
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_BASEPATH" ]]; then
|
||||
if [[ -z "$SOLR_BASEPATH" ]]; then
|
||||
SOLR_BASEPATH=/solr
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_BASEURL" ]]; then
|
||||
SOLR_BASEURL=${SOLR_PROTOCOL}://${SOLR_HOST}:${SOLR_PORT}/$SOLR_BASEPATH
|
||||
if [[ -z "$SOLR_BASEURL" ]]; then
|
||||
SOLR_BASEURL=${SOLR_PROTOCOL}://${SOLR_HOST}:${SOLR_PORT}${SOLR_BASEPATH}
|
||||
fi
|
||||
echo "Solr Base URL: ${SOLR_BASEURL}"
|
||||
|
||||
if [[ ! -z "$SOLR_CORE" ]]; then
|
||||
if [[ -z "$SOLR_CORE" ]]; then
|
||||
SOLR_CORE=alfresco
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_LOCALPATH" ]]; then
|
||||
if [[ -z "$SOLR_LOCALPATH" ]]; then
|
||||
SOLR_LOCALPATH=/tmp
|
||||
fi
|
||||
|
||||
if [[ ! -z "$SOLR_TEMPLATE" ]]; then
|
||||
if [[ -z "$SOLR_TEMPLATE" ]]; then
|
||||
SOLR_TEMPLATE=rerank
|
||||
fi
|
||||
|
0
solr-backup.sh
Normal file → Executable file
0
solr-backup.sh
Normal file → Executable file
20
solr-create.sh
Normal file → Executable file
20
solr-create.sh
Normal file → Executable file
@@ -8,18 +8,28 @@ ARG_SOLR_NODE_ID=$3
|
||||
ARG_SOLR_NODES=$4
|
||||
|
||||
if [[ ! -z "$ARG_SOLR_SHARD_IDS" ]]; then
|
||||
if [[ ! -z "$ARG_SOLR_SHARDS" ]]; then
|
||||
if [[ -z "$ARG_SOLR_SHARDS" ]]; then
|
||||
echo "The expected number of shards is required"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -z "$ARG_SOLR_NODE_ID" ]]; then
|
||||
if [[ -z "$ARG_SOLR_NODE_ID" ]]; then
|
||||
ARG_SOLR_NODE_ID=1
|
||||
echo "A Solr instance node ID was not specified; using '1'"
|
||||
fi
|
||||
if [[ ! -z "$ARG_SOLR_NODES" ]]; then
|
||||
if [[ -z "$ARG_SOLR_NODES" ]]; then
|
||||
ARG_SOLR_NODES=1
|
||||
echo "A total number of Solr instances was not specified; using '1'"
|
||||
fi
|
||||
|
||||
curl -SsL ${SOLR_BASEURL}/admin/cores?action=newCore\\&core=${SOLR_CORE}\\&storeRef=workspace://SpacesStore\\&numShards=${ARG_SOLR_SHARDS}\\&nodeInstance=${ARG_SOLR_NODE_ID}\\&numNodes=${ARG_SOLR_NODES}\\&template=${SOLR_TEMPLATE}\\&shardIds=${ARG_SOLR_SHARD_IDS}
|
||||
echo "Creating a shard core in the Solr instance ..."
|
||||
SOLR_URL="${SOLR_BASEURL}/admin/cores?action=newCore&core=${SOLR_CORE}&storeRef=workspace://SpacesStore&numShards=${ARG_SOLR_SHARDS}&nodeInstance=${ARG_SOLR_NODE_ID}&numNodes=${ARG_SOLR_NODES}&template=${SOLR_TEMPLATE}&shardIds=${ARG_SOLR_SHARD_IDS}"
|
||||
else
|
||||
curl -SsL ${SOLR_BASEURL}/admin/cores?action=newCore\\&core=${SOLR_CORE}\\&storeRef=workspace://SpacesStore\\&template=${SOLR_TEMPLATE}
|
||||
echo "No arguments were specified; creating a shard-less core in the Solr instance ..."
|
||||
SOLR_URL="${SOLR_BASEURL}/admin/cores?action=newCore&core=${SOLR_CORE}&storeRef=workspace://SpacesStore&template=${SOLR_TEMPLATE}"
|
||||
fi
|
||||
|
||||
if [[ ! -z "$DEBUG" ]]; then
|
||||
echo "URL: ${SOLR_URL}"
|
||||
fi
|
||||
curl -SsL ${SOLR_URL}
|
||||
|
||||
|
0
solr-docker-copy.sh
Normal file → Executable file
0
solr-docker-copy.sh
Normal file → Executable file
0
solr-migrate-shard.sh
Normal file → Executable file
0
solr-migrate-shard.sh
Normal file → Executable file
0
solr-pause.sh
Normal file → Executable file
0
solr-pause.sh
Normal file → Executable file
9
solr-remove.sh
Normal file → Executable file
9
solr-remove.sh
Normal file → Executable file
@@ -7,4 +7,11 @@ if [[ ! -z "$ARG_SOLR_SHARD_ID" ]]; then
|
||||
SOLR_CORE=${SOLR_CORE}-${ARG_SOLR_SHARD_ID}
|
||||
fi
|
||||
|
||||
curl -SsL ${SOLR_BASEURL}/admin/cores?action=UNLOAD\&core=${SOLR_CORE}\&deleteIndex=true\&deleteDataDir=true\&deleteInstanceDir=true
|
||||
echo "Removing a core in the Solr instance ..."
|
||||
SOLR_URL="${SOLR_BASEURL}/admin/cores?action=UNLOAD&core=${SOLR_CORE}&deleteIndex=true&deleteDataDir=true&deleteInstanceDir=true"
|
||||
|
||||
if [[ ! -z "$DEBUG" ]]; then
|
||||
echo "URL: ${SOLR_URL}"
|
||||
fi
|
||||
curl -SsL ${SOLR_URL}
|
||||
|
||||
|
0
solr-restore.sh
Normal file → Executable file
0
solr-restore.sh
Normal file → Executable file
0
solr-resume.sh
Normal file → Executable file
0
solr-resume.sh
Normal file → Executable file
0
solr-ssh-copy.sh
Normal file → Executable file
0
solr-ssh-copy.sh
Normal file → Executable file
Reference in New Issue
Block a user