Skip to content

Instantly share code, notes, and snippets.

@ChadRehmKineticData
Created May 6, 2019 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChadRehmKineticData/b2e3210a4a31aa4fc55774402167d7b5 to your computer and use it in GitHub Desktop.
Save ChadRehmKineticData/b2e3210a4a31aa4fc55774402167d7b5 to your computer and use it in GitHub Desktop.
kin - leid - platform
#!/bin/bash
# TODO fix these problems
: '
Creating cores
Please remember this operation is DC specific and should be repeated on each desired DC.
'
base=$(dirname $(readlink -f $0))
nodes=1
echo "Creating keyspaces"
for keyspace in csa_mgmt rr_mgmt srvc_mgmt dev_search catalog_search
do
# echo "DROP KEYSPACE IF EXISTS $keyspace;"
echo "CREATE KEYSPACE IF NOT EXISTS $keyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : $nodes };"
done | docker-compose exec -T datastax cqlsh
echo "Creating roles"
for role in search_user csa_user
do
echo "DROP ROLE IF EXISTS '$role';"
echo "CREATE ROLE IF NOT EXISTS '$role' WITH LOGIN = true AND PASSWORD = '$role';"
done | docker-compose exec -T datastax cqlsh
echo "Creating schema"
for file in $base/schema/*.cql
do
echo "Loading $file"
docker-compose exec -T datastax cqlsh < "$file"
done
echo "Creating cores"
for xml in $(/bin/ls $base/solr/*.xml)
do
core=$(basename $xml .xml)
echo $core
docker-compose exec -T datastax dsetool --ssl=false create_core $core generateResources=true reindex=true
docker-compose exec -T datastax dsetool reload_core $core schema=/dev/stdin reindex=true < $xml
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment