From a92c7a7ce4258729ab6589ee17a035a1b446965c Mon Sep 17 00:00:00 2001 From: jialiang Date: Tue, 18 Mar 2025 12:08:05 +0800 Subject: [PATCH] AMBARI-26334: Fix execute_db_connection_check failed error --- .../HDP/2.0.7/services/HIVE/package/scripts/hive_service.py | 2 +- .../src/main/resources/custom_actions/scripts/check_host.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py b/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py index edaeecb6558..08aec2fdd0b 100644 --- a/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py +++ b/ambari-funtest/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py @@ -47,7 +47,7 @@ def hive_service(name, action="start"): or params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver" ): db_connection_check_command = format( - "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd} {hive_jdbc_driver}" + "{ambari_java_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd} {hive_jdbc_driver}" ) Execute( db_connection_check_command, path="/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin" diff --git a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py index a8226dba19c..f3deffa4a83 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py @@ -371,7 +371,8 @@ def execute_db_connection_check(self, config, tmp_dir): ambari_server_hostname = config["commandParams"]["ambari_server_host"] check_db_connection_jar_name = "DBConnectionVerification.jar" jdk_location = config["commandParams"]["jdk_location"] - java_home = config["commandParams"]["java_home"] + ambari_java_home = config["ambariLevelParams"]["ambari_java_home"] + java_home = ambari_java_home db_name = config["commandParams"]["db_name"] no_jdbc_error_message = None