Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Pull in AAF Env Variables from AAF install |
| 4 | if [ -e ../../docker/d.props ]; then |
| 5 | . ../../docker/d.props |
| 6 | else |
| 7 | . ../../docker/d.props.init |
| 8 | fi |
| 9 | |
| 10 | if [ -e /usr/bin/docker ]; then |
| 11 | DOCKER=/usr/bin/docker |
| 12 | elif [ -e /usr/local/bin/docker ]; then |
| 13 | DOCKER=/usr/local/bin/docker |
| 14 | else |
| 15 | echo Docker not available in /usr/bin or /usr/local/bin |
| 16 | exit |
| 17 | fi |
| 18 | |
| 19 | if [ "$($DOCKER volume ls | grep aaf_cass_data)" = "" ]; then |
| 20 | $DOCKER volume create aaf_cass_data |
| 21 | echo "Created Cassandra Volume aaf_cass_data" |
| 22 | fi |
| 23 | |
| 24 | if [ "`$DOCKER ps -a | grep aaf_cass`" == "" ]; then |
| 25 | echo "starting Cass from 'run'" |
| 26 | # NOTE: These HEAP Sizes are minimal. Not set for full organizations. |
| 27 | $DOCKER run \ |
| 28 | --name aaf_cass \ |
| 29 | -e HEAP_NEWSIZE=512M \ |
| 30 | -e MAX_HEAP_SIZE=1024M \ |
| 31 | -e CASSANDRA_DC=dc1 \ |
| 32 | -e CASSANDRA_CLUSTER_NAME=osaaf \ |
| 33 | --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \ |
| 34 | -d ${ORG}/${PROJECT}/aaf_cass:${VERSION} |
| 35 | else |
| 36 | $DOCKER start aaf_cass |
| 37 | fi |