generated from kbase/kbase-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25f67eb
commit 128e2a3
Showing
7 changed files
with
148 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<configuration> | ||
<property> | ||
<name>javax.jdo.option.ConnectionURL</name> | ||
<value>jdbc:postgresql://{{POSTGRES_URL}}/{{POSTGRES_DB}}</value> | ||
</property> | ||
|
||
<!-- JDBC driver class name for PostgreSQL --> | ||
<!-- Ensure that PostgreSQL JDBC driver jars are included via Gradle --> | ||
<property> | ||
<name>javax.jdo.option.ConnectionDriverName</name> | ||
<value>org.postgresql.Driver</value> | ||
</property> | ||
<property> | ||
<name>javax.jdo.option.ConnectionUserName</name> | ||
<value>{{POSTGRES_USER}}</value> | ||
</property> | ||
<property> | ||
<name>javax.jdo.option.ConnectionPassword</name> | ||
<value>{{POSTGRES_PASSWORD}}</value> | ||
</property> | ||
|
||
<!-- Configuration to automatically create the necessary tables in the database schema if they don't exist --> | ||
<!-- Hive metastore fails to start if this property is not set--> | ||
<property> | ||
<name>datanucleus.schema.autoCreateTables</name> | ||
<value>true</value> | ||
</property> | ||
|
||
<!-- Disable schema verification in the Hive metastore --> | ||
<!-- Hive metastore fails to start if this property is not set--> | ||
<property> | ||
<name>hive.metastore.schema.verification</name> | ||
<value>false</value> | ||
</property> | ||
|
||
<!-- Directory location for the Hive warehouse where table data is stored --> | ||
<property> | ||
<name>hive.metastore.warehouse.dir</name> | ||
<value>/cdm_shared_workspace/hive_metastore</value> | ||
</property> | ||
|
||
<!-- Enable support for concurrency in Hive, allowing multiple users to access and modify the data simultaneously --> | ||
<property> | ||
<name>hive.support.concurrency</name> | ||
<value>true</value> | ||
</property> | ||
</configuration> |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# This script sets up the Spark environment variables and configurations for Spark master, worker, and driver (Jupyter) nodes. | ||
|
||
# Load Spark environment variables | ||
source /opt/bitnami/scripts/spark-env.sh | ||
if [ -z "$SPARK_CONF_FILE" ]; then | ||
echo "Error: unable to find SPARK_CONF_FILE path" | ||
exit 1 | ||
fi | ||
|
||
# Set Spark configurations | ||
{ | ||
# Set dynamic allocation configurations to allow parallel job executions | ||
if [ -z "$MAX_EXECUTORS" ]; then | ||
# If MAX_EXECUTORS is not set, default to 5. Adjust as needed. | ||
MAX_EXECUTORS=5 | ||
fi | ||
echo "spark.dynamicAllocation.enabled true" | ||
echo "spark.dynamicAllocation.minExecutors 1" | ||
echo "spark.dynamicAllocation.maxExecutors $MAX_EXECUTORS" | ||
|
||
# Set spark.driver.host if SPARK_DRIVER_HOST is set | ||
if [ -n "$SPARK_DRIVER_HOST" ]; then | ||
echo "spark.driver.host $SPARK_DRIVER_HOST" | ||
fi | ||
} >> "$SPARK_CONF_FILE" | ||
|
||
# Config hive-site.xml for Hive support | ||
sed -e "s|{{POSTGRES_URL}}|${POSTGRES_URL}|g" \ | ||
-e "s|{{POSTGRES_DB}}|${POSTGRES_DB}|g" \ | ||
-e "s|{{POSTGRES_USER}}|${POSTGRES_USER}|g" \ | ||
-e "s|{{POSTGRES_PASSWORD}}|${POSTGRES_PASSWORD}|g" \ | ||
/opt/config/hive-site-template.xml > "$SPARK_HOME"/conf/hive-site.xml |