blob: 9362896d9b58b52a36bc246677c2866d1defe0fd [file] [log] [blame]
Instrumental924b18d2018-04-05 20:17:18 -05001#!/bin/bash dinstall
Sai Gandham1eb66782018-03-30 14:07:11 -05002if ["`docker ps -a | grep aaf_cass`" == ""]; then
Instrumental71037c32018-03-26 13:51:48 -07003 docker run --name aaf_cass -d cassandra:3.11
Instrumental4d7da3d2018-04-06 08:22:42 -05004 echo "Check for running Docker Container aaf_cass, then run again."
5 exit
6else
Instrumental71037c32018-03-26 13:51:48 -07007 docker exec aaf_cass mkdir -p /opt/app/cass_init
8 docker cp "../src/main/cql/." aaf_cass:/opt/app/cass_init
Instrumental4d7da3d2018-04-06 08:22:42 -05009fi
Instrumental71037c32018-03-26 13:51:48 -070010
11echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
12echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
13echo ""
14echo " cd /opt/app/cass_init"
15echo " cqlsh -u root -p root -f keyspace.cql"
16echo " cqlsh -u root -p root -f init.cql"
17echo " cqlsh -u root -p root -f osaaf.cql"
18echo ""
19echo "The following will give you a temporary identity with which to start working, or emergency"
20echo " cqlsh -u root -p root -f temp_identity.cql"
Instrumental4d7da3d2018-04-06 08:22:42 -050021echo "Sleeping for 10 seconds"
Instrumental71037c32018-03-26 13:51:48 -070022sleep 10
23docker exec -it aaf_cass bash -c '\
24cd /opt/app/cass_init; \
25echo "Creating Keyspace";cqlsh -u root -p root -f keyspace.cql;\
26echo "Creating init";cqlsh -u root -p root -f init.cql;\
27echo "Creating osaaf";cqlsh -u root -p root -f osaaf.cql;\
28echo "Creating temp Identity";cqlsh -u root -p root -f temp_identity.cql'
29
30echo "Inspecting aafcassadra. Use to get the IP address to update org.osaaf.cassandra.props"
31docker inspect aaf_cass | grep '"IPAddress' | head -1