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