blob: 2ccb519e2fcc6e92030ffa1e099afcb00142e000 [file] [log] [blame]
Instrumental97083ef2018-04-25 15:22:38 -05001#!/bin/bash
Instrumental71037c32018-03-26 13:51:48 -07002
Instrumental2fe00d02018-05-11 06:30:40 -05003docker exec aaf_cass mkdir -p /opt/app/cass_init
4docker cp "../src/main/cql/." aaf_cass:/opt/app/cass_init
Instrumentalf482ea02018-04-10 15:03:24 -05005
Instrumental71037c32018-03-26 13:51:48 -07006echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
7echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
8echo ""
9echo " cd /opt/app/cass_init"
10echo " cqlsh -u root -p root -f keyspace.cql"
11echo " cqlsh -u root -p root -f init.cql"
12echo " cqlsh -u root -p root -f osaaf.cql"
13echo ""
14echo "The following will give you a temporary identity with which to start working, or emergency"
15echo " cqlsh -u root -p root -f temp_identity.cql"
Instrumental2fe00d02018-05-11 06:30:40 -050016echo "Sleeping for 20 seconds"
17sleep 20
18echo "Do a repair, to ensure Cassandra is actually running yet"
19docker exec -it aaf_cass bash -c 'nodetool repair'
20
21echo "Create Keyspaces and Tables""
Instrumental71037c32018-03-26 13:51:48 -070022docker exec -it aaf_cass bash -c '\
23cd /opt/app/cass_init; \
24echo "Creating Keyspace";cqlsh -u root -p root -f keyspace.cql;\
25echo "Creating init";cqlsh -u root -p root -f init.cql;\
26echo "Creating osaaf";cqlsh -u root -p root -f osaaf.cql;\
27echo "Creating temp Identity";cqlsh -u root -p root -f temp_identity.cql'
28
29echo "Inspecting aafcassadra. Use to get the IP address to update org.osaaf.cassandra.props"
30docker inspect aaf_cass | grep '"IPAddress' | head -1