Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | cd /root |
| 4 | |
| 5 | CS_PORT="" |
| 6 | CS_HOST=127.0.0.1 |
| 7 | |
| 8 | if [ ! -z "${CS_HOST_IP}" ]; then |
| 9 | CS_HOST=$CS_HOST_IP |
| 10 | fi |
| 11 | |
| 12 | if [ ! -z "${CS_HOST_PORT}" ]; then |
| 13 | CS_PORT=$CS_HOST_PORT |
| 14 | fi |
| 15 | |
| 16 | echo "[Info] Going to initialize sdc onboard cassandra: user=$SDC_USER; host=$CS_HOST; port=$CS_PORT" |
| 17 | echo "[Info] Initializing onboard keyspaces" |
| 18 | cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_keyspaces.cql $CS_HOST $CS_PORT |
| 19 | |
| 20 | echo "[Info] Initializing onboard schemas" |
| 21 | cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_schemas.cql $CS_HOST $CS_PORT |
| 22 | |
| 23 | rc=$? |
| 24 | if [[ $rc != 0 ]]; then exit $rc; fi |