-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow backing DB choice of mysql or postgres, remove hardcoding…
… of db settings (#55)
- Loading branch information
Showing
6 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#!/bin/sh | ||
|
||
export METASTORE_DB_HOSTNAME=${METASTORE_DB_HOSTNAME:-localhost} | ||
export METASTORE_DB_PORT=${METASTORE_DB_PORT:-3306} | ||
export METASTORE_DB_TYPE=${METASTORE_DB_TYPE:-mysql} | ||
|
||
echo "Waiting for database on ${METASTORE_DB_HOSTNAME} to launch on 3306 ..." | ||
echo "Waiting for database on ${METASTORE_DB_HOSTNAME} to launch on ${METASTORE_DB_PORT} ..." | ||
|
||
while ! nc -z ${METASTORE_DB_HOSTNAME} 3306; do | ||
while ! nc -z ${METASTORE_DB_HOSTNAME} ${METASTORE_DB_PORT}; do | ||
sleep 1 | ||
done | ||
|
||
echo "Database on ${METASTORE_DB_HOSTNAME}:3306 started" | ||
echo "Init apache hive metastore on ${METASTORE_DB_HOSTNAME}:3306" | ||
echo "Database on ${METASTORE_DB_HOSTNAME}:${METASTORE_DB_PORT} started" | ||
echo "Init apache hive metastore on ${METASTORE_DB_HOSTNAME}:${METASTORE_DB_PORT}" | ||
|
||
/opt/apache-hive-metastore-3.1.3-bin/bin/schematool -initSchema -dbType mysql | ||
/opt/apache-hive-metastore-3.1.3-bin/bin/start-metastore | ||
/opt/apache-hive-metastore-3.1.3-bin/bin/schematool -initSchema -dbType ${METASTORE_DB_TYPE} | ||
/opt/apache-hive-metastore-3.1.3-bin/bin/start-metastore |