From 45a51bab28beec474df8ec3eb2b81f5758820740 Mon Sep 17 00:00:00 2001 From: janli Date: Fri, 21 Jun 2024 10:36:34 -0700 Subject: [PATCH] fix: set default connector jar path --- CHANGELOG.md | 7 +++++++ files/startup.sh | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2feab79..5d9cceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [5.0.2] - 2024-06-21 +### Fixed +- Set default `AUX_CLASSPATH` based on `MYSQL_TYPE`. + - When `mysql`, then set to `/usr/share/java/mysql-connector-java.jar`. + - When `mariadb` then set to `/usr/share/java/mariadb-connector-java.jar`. + - Else set to `MYSQL_DRIVER_JAR`. + ## [5.0.1] - 2024-06-19 ### Fixed - Added `MYSQL_DRIVER_JAR` to add the driver connector JAR to the system classpath. By default it is now using `/usr/share/java/mysql-connector-java.jar`. diff --git a/files/startup.sh b/files/startup.sh index 66d301f..89abdb9 100755 --- a/files/startup.sh +++ b/files/startup.sh @@ -182,7 +182,18 @@ sed "s/METASTORE_PRELISTENERS/${METASTORE_PRELISTENERS}/" -i /etc/hive/conf/hive #required to debug ranger plugin, todo: send apache common logs to cloudwatch #export HADOOP_OPTS="$HADOOP_OPTS -Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog" -export AUX_CLASSPATH="${MYSQL_DRIVER_JAR:-/usr/share/java/mysql-connector-java.jar}" +# Set AUX_CLASSPATH to mysql-connector-java.jar or mariadb-connector-java.jar as default. +case ${MYSQL_TYPE:-mysql} in + mysql) + export AUX_CLASSPATH=/usr/share/java/mysql-connector-java.jar + ;; + mariadb) + export AUX_CLASSPATH=/usr/share/java/mariadb-connector-java.jar + ;; + *) + export AUX_CLASSPATH=$MYSQL_DRIVER_JAR +esac + [[ ! -z $SNS_ARN ]] && export AUX_CLASSPATH="$AUX_CLASSPATH:/usr/lib/apiary/apiary-metastore-listener-${APIARY_EXTENSIONS_VERSION}-all.jar" [[ ! -z $KAFKA_BOOTSTRAP_SERVERS ]] && export AUX_CLASSPATH="$AUX_CLASSPATH:/usr/lib/apiary/kafka-metastore-listener-${APIARY_EXTENSIONS_VERSION}-all.jar:/usr/lib/apiary/kafka-clients-${KAFKA_VERSION}.jar" [[ ! -z $ENABLE_GLUESYNC ]] && export AUX_CLASSPATH="$AUX_CLASSPATH:/usr/lib/apiary/apiary-gluesync-listener-${APIARY_GLUESYNC_LISTENER_VERSION}-all.jar"