blob: 3726b6d2a1ea5b52aa69db484d487aab29af89db [file] [log] [blame]
Sai Gandham1eb66782018-03-30 14:07:11 -05001if ["`docker ps -a | grep aaf_cass`" == ""]; then
Instrumental71037c32018-03-26 13:51:48 -07002 docker run --name aaf_cass -d cassandra:3.11
Instrumental4d7da3d2018-04-06 08:22:42 -05003 echo "Check for running Docker Container aaf_cass, then run again."
4 exit
5else
Instrumental71037c32018-03-26 13:51:48 -07006 docker exec aaf_cass mkdir -p /opt/app/cass_init
7 docker cp "../src/main/cql/." aaf_cass:/opt/app/cass_init
Instrumental4d7da3d2018-04-06 08:22:42 -05008fi
Instrumental71037c32018-03-26 13:51:48 -07009
Instrumentalf482ea02018-04-10 15:03:24 -050010
Instrumental71037c32018-03-26 13:51:48 -070011echo "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