Repository: ambari Updated Branches: refs/heads/branch-2.6 761600d29 -> 077b6d190
AMBARI-22362 - Specify the Correct HIVE_BIN In Hive Scripts (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/077b6d19 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/077b6d19 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/077b6d19 Branch: refs/heads/branch-2.6 Commit: 077b6d190d9f7c8503e572476f4051e9537ca3f4 Parents: 761600d Author: Jonathan Hurley <[email protected]> Authored: Fri Nov 3 10:07:54 2017 -0400 Committer: Jonathan Hurley <[email protected]> Committed: Fri Nov 3 10:08:02 2017 -0400 ---------------------------------------------------------------------- .../0.12.0.2.0/package/files/startMetastore.sh | 4 ++-- .../0.12.0.2.0/package/scripts/hive_service.py | 10 ++-------- .../0.12.0.2.0/package/scripts/params_linux.py | 3 +-- .../0.12.0.2.0/package/scripts/service_check.py | 6 ++---- .../services/HIVE/package/files/startMetastore.sh | 4 ++-- .../services/HIVE/package/scripts/hive_service.py | 9 +-------- .../4.0/services/HIVE/package/scripts/params.py | 5 +---- .../services/HIVE/package/files/startMetastore.sh | 4 ++-- .../services/HIVE/package/scripts/hive_service.py | 9 +-------- .../services/HIVE/package/scripts/params_linux.py | 5 +---- .../stacks/2.0.6/HIVE/test_hive_metastore.py | 8 +++----- .../python/stacks/2.0.6/HIVE/test_hive_server.py | 18 ++++++------------ .../stacks/2.0.6/HIVE/test_hive_service_check.py | 2 +- .../python/stacks/2.1/HIVE/test_hive_metastore.py | 9 +++------ 14 files changed, 28 insertions(+), 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/startMetastore.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/startMetastore.sh b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/startMetastore.sh index 86541f0..5a556b2 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/startMetastore.sh +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/startMetastore.sh @@ -19,7 +19,7 @@ # under the License. # # -HIVE_BIN=${HIVE_BIN:-"hive"} +HIVE_CMD=${HIVE_CMD:-"hive"} -HIVE_CONF_DIR=$4 $HIVE_BIN --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & +HIVE_CONF_DIR=$4 $HIVE_CMD --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & echo $!|cat>$3 http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py index 3c42559..eec9031 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py @@ -76,8 +76,6 @@ def hive_service(name, action='start', upgrade_type=None): check_fs_root(params.hive_server_conf_dir, params.execute_path) daemon_cmd = cmd - hadoop_home = params.hadoop_home - hive_bin = "hive" # upgrading hiveserver2 (rolling_restart) means that there is an existing, # de-registering hiveserver2; the pid will still exist, but the new @@ -85,13 +83,9 @@ def hive_service(name, action='start', upgrade_type=None): if upgrade_type == UPGRADE_TYPE_ROLLING: process_id_exists_command = None - if params.version and params.stack_root: - hadoop_home = format("{stack_root}/{version}/hadoop") - hive_bin = os.path.join(params.hive_bin, hive_bin) - - Execute(daemon_cmd, + Execute(daemon_cmd, user = params.hive_user, - environment = { 'HADOOP_HOME': hadoop_home, 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_bin }, + environment = { 'JAVA_HOME': params.java64_home, 'HIVE_CMD': params.hive_cmd }, path = params.execute_path, not_if = process_id_exists_command) http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py index 9c6db00..18e2978 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py @@ -112,6 +112,7 @@ component_directory_interactive = status_params.component_directory_interactive hadoop_home = stack_select.get_hadoop_dir("home") hive_bin = format('{stack_root}/current/{component_directory}/bin') +hive_cmd = os.path.join(hive_bin, "hive") hive_schematool_ver_bin = format('{stack_root}/{version}/hive/bin') hive_schematool_bin = format('{stack_root}/current/{component_directory}/bin') hive_lib = format('{stack_root}/current/{component_directory}/lib') @@ -186,8 +187,6 @@ hive_server_conf_dir = status_params.hive_server_conf_dir hcat_conf_dir = '/etc/hive-hcatalog/conf' config_dir = '/etc/hive-webhcat/conf' -hcat_lib = '/usr/lib/hive-hcatalog/share/hcatalog' -webhcat_bin_dir = '/usr/lib/hive-hcatalog/sbin' # there are no client versions of these, use server versions directly hcat_lib = format('{stack_root}/current/hive-webhcat/share/hcatalog') http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py index db253d3..d379726 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py @@ -170,10 +170,8 @@ class HiveServiceCheckDefault(HiveServiceCheck): if kinit_cmd: beeline_url.append('principal={key}') - exec_path = params.execute_path - if params.version: - upgrade_hive_bin = format("{stack_root}/{version}/hive2/bin") - exec_path = os.environ['PATH'] + os.pathsep + params.hadoop_bin_dir + os.pathsep + upgrade_hive_bin + hive_interactive_bin = format("{stack_root}/current/hive-server2-hive2/bin") + exec_path = os.environ['PATH'] + os.pathsep + params.hadoop_bin_dir + os.pathsep + hive_interactive_bin # beeline path llap_cmd = "! beeline -u '%s'" % format(";".join(beeline_url)) http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/files/startMetastore.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/files/startMetastore.sh b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/files/startMetastore.sh index 86541f0..5a556b2 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/files/startMetastore.sh +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/files/startMetastore.sh @@ -19,7 +19,7 @@ # under the License. # # -HIVE_BIN=${HIVE_BIN:-"hive"} +HIVE_CMD=${HIVE_CMD:-"hive"} -HIVE_CONF_DIR=$4 $HIVE_BIN --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & +HIVE_CONF_DIR=$4 $HIVE_CMD --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & echo $!|cat>$3 http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/hive_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/hive_service.py index c3bf30c..7e4e560 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/hive_service.py +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/hive_service.py @@ -66,8 +66,6 @@ def hive_service(name, action='start', upgrade_type=None): check_fs_root() daemon_cmd = cmd - hadoop_home = params.hadoop_home - hive_bin = "hive" # upgrading hiveserver2 (rolling_restart) means that there is an existing, # de-registering hiveserver2; the pid will still exist, but the new @@ -75,18 +73,13 @@ def hive_service(name, action='start', upgrade_type=None): if upgrade_type == UPGRADE_TYPE_ROLLING: process_id_exists_command = None - if (params.version): - import os - hadoop_home = format("/usr/iop/{version}/hadoop") - hive_bin = os.path.join(params.hive_bin, hive_bin) - if params.security_enabled: hive_kinit_cmd = format("{kinit_path_local} -kt {hive_server2_keytab} {hive_principal}; ") Execute(hive_kinit_cmd, user=params.hive_user) Execute(daemon_cmd, user = params.hive_user, - environment = { 'HADOOP_HOME': hadoop_home, 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_bin }, + environment = { 'JAVA_HOME': params.java64_home, 'HIVE_CMD': params.hive_cmd }, path = params.execute_path, not_if = process_id_exists_command) http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/params.py index 8f2132a..2e1eb41 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/params.py @@ -71,8 +71,6 @@ version_for_stack_feature_checks = get_stack_feature_version(config) component_directory = status_params.component_directory hadoop_bin_dir = "/usr/bin" hadoop_home = '/usr' -hive_bin = '/usr/lib/hive/bin' -hive_lib = '/usr/lib/hive/lib' #Hbase params keep hbase lib here,if not,mapreduce job doesn't work for hive. hbase_lib = '/usr/iop/current/hbase-client/lib' @@ -95,6 +93,7 @@ if command_role in server_role_dir_mapping: hive_bin = format('/usr/iop/current/{hive_server_root}/bin') hive_lib = format('/usr/iop/current/{hive_server_root}/lib') +hive_cmd = os.path.join(hive_bin, "hive") hive_specific_configs_supported = False hive_etc_dir_prefix = "/etc/hive" limits_conf_dir = "/etc/security/limits.d" @@ -117,8 +116,6 @@ hcat_lib = '/usr/iop/current/hive-webhcat/share/hcatalog' webhcat_bin_dir = '/usr/iop/current/hive-webhcat/sbin' component_directory = status_params.component_directory hadoop_home = '/usr/iop/current/hadoop-client' -hive_bin = format('/usr/iop/current/{component_directory}/bin') -hive_lib = format('/usr/iop/current/{component_directory}/lib') # there are no client versions of these, use server versions directly hcat_lib = '/usr/iop/current/hive-webhcat/share/hcatalog' http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/files/startMetastore.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/files/startMetastore.sh b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/files/startMetastore.sh index 86541f0..5a556b2 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/files/startMetastore.sh +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/files/startMetastore.sh @@ -19,7 +19,7 @@ # under the License. # # -HIVE_BIN=${HIVE_BIN:-"hive"} +HIVE_CMD=${HIVE_CMD:-"hive"} -HIVE_CONF_DIR=$4 $HIVE_BIN --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & +HIVE_CONF_DIR=$4 $HIVE_CMD --service metastore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=$5 > $1 2> $2 & echo $!|cat>$3 http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/hive_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/hive_service.py index b564057..1c59329 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/hive_service.py +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/hive_service.py @@ -68,8 +68,6 @@ def hive_service(name, action='start', upgrade_type=None): check_fs_root() daemon_cmd = cmd - hadoop_home = params.hadoop_home - hive_bin = "hive" # upgrading hiveserver2 (rolling_restart) means that there is an existing, # de-registering hiveserver2; the pid will still exist, but the new @@ -77,14 +75,9 @@ def hive_service(name, action='start', upgrade_type=None): if upgrade_type == UPGRADE_TYPE_ROLLING: process_id_exists_command = None - if params.version: - import os - hadoop_home = format("/usr/iop/{version}/hadoop") - hive_bin = os.path.join(params.hive_bin, hive_bin) - Execute(daemon_cmd, user = params.hive_user, - environment = { 'HADOOP_HOME': hadoop_home, 'JAVA_HOME': params.java64_home, 'HIVE_BIN': hive_bin }, + environment = { 'JAVA_HOME': params.java64_home, 'HIVE_CMD': params.hive_cmd }, path = params.execute_path, not_if = process_id_exists_command) http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/params_linux.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/params_linux.py index 528760a..efcd499 100755 --- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HIVE/package/scripts/params_linux.py @@ -78,8 +78,6 @@ stack_supports_ranger_audit_db = check_stack_feature(StackFeature.RANGER_AUDIT_D component_directory = status_params.component_directory hadoop_bin_dir = "/usr/bin" hadoop_home = '/usr' -hive_bin = '/usr/lib/hive/bin' -hive_lib = '/usr/lib/hive/lib' #Hbase params keep hbase lib here,if not,mapreduce job doesn't work for hive. hbase_lib = '/usr/iop/current/hbase-client/lib' @@ -103,6 +101,7 @@ if command_role in server_role_dir_mapping: hive_bin = format('/usr/iop/current/{hive_server_root}/bin') hive_lib = format('/usr/iop/current/{hive_server_root}/lib') +hive_cmd = os.path.join(hive_bin, "hive") hive_specific_configs_supported = False hive_etc_dir_prefix = "/etc/hive" limits_conf_dir = "/etc/security/limits.d" @@ -138,8 +137,6 @@ if Script.is_stack_greater_or_equal("4.1.0.0"): component_directory = status_params.component_directory hadoop_home = '/usr/iop/current/hadoop-client' -hive_bin = format('/usr/iop/current/{component_directory}/bin') -hive_lib = format('/usr/iop/current/{component_directory}/lib') # there are no client versions of these, use server versions directly hcat_lib = '/usr/iop/current/hive-webhcat/share/hcatalog' http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py index 452c0b6..a2b983e 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py @@ -62,8 +62,7 @@ class TestHiveMetastore(RMFTestCase): self.assert_configure_default() self.assert_init_schema() self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -123,8 +122,7 @@ class TestHiveMetastore(RMFTestCase): self.assert_configure_secured() self.assert_init_schema() self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/2.1.0.0-1234/hadoop', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -549,7 +547,7 @@ class TestHiveMetastore(RMFTestCase): user = 'hive') self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/2.3.0.0-1234/hadoop', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45', 'HIVE_BIN': '/usr/hdp/current/hive-server2/bin/hive'}, + environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45', 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive'}, not_if = None, user = 'hive', path = ['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/2.3.0.0-1234/hadoop/bin']) http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py index fd92277..fa230cb 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py @@ -93,8 +93,7 @@ class TestHiveServer(RMFTestCase): user='hive' ) self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -124,8 +123,7 @@ class TestHiveServer(RMFTestCase): self.assert_configure_default(default_fs_default='hcfs://c6401.ambari.apache.org:8020') self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = {'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -155,8 +153,7 @@ class TestHiveServer(RMFTestCase): user = 'hive', ) self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -186,8 +183,7 @@ class TestHiveServer(RMFTestCase): user = 'hive', ) self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -217,8 +213,7 @@ class TestHiveServer(RMFTestCase): user = 'hive', ) self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -290,8 +285,7 @@ class TestHiveServer(RMFTestCase): self.assert_configure_secured() self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': 'mock_hadoop_dir', - 'HIVE_BIN': 'hive', + environment = { 'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py index 3421189..7dea5db 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py @@ -340,7 +340,7 @@ class TestServiceCheck(RMFTestCase): # LLAP call self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10500/;transportMode=binary' --hiveconf \"hiveLlapServiceCheck=\" -f /usr/hdp/current/hive-server2-hive2/scripts/llap/sql/serviceCheckScript.sql -e '' 2>&1| awk '{print}'|grep -i -e 'Invalid status\|Invalid URL\|command not found\|Connection refused'", - path = ['/usr/sbin', '/usr/local/bin', '/bin', '/usr/bin', '/bin:/usr/hdp/2.3.0.0-1234/hadoop/bin:/usr/hdp/2.3.0.0-1234/hive2/bin'], + path = ['/usr/sbin', '/usr/local/bin', '/bin', '/usr/bin', '/bin:/usr/hdp/2.3.0.0-1234/hadoop/bin:/usr/hdp/current/hive-server2-hive2/bin'], tries = 1, stderr = -1, wait_for_finish = True, http://git-wip-us.apache.org/repos/asf/ambari/blob/077b6d19/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py index e497f33..73f5fe6 100644 --- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py @@ -70,8 +70,7 @@ class TestHiveMetastore(RMFTestCase): self.assert_init_schema('aaa') self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/2.2.1.0-2067/hadoop', - 'HIVE_BIN': 'hive', + environment = {'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -101,8 +100,7 @@ class TestHiveMetastore(RMFTestCase): self.assert_init_schema('aaa') self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/2.2.1.0-2067/hadoop', - 'HIVE_BIN': 'hive', + environment = {'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive', @@ -164,8 +162,7 @@ class TestHiveMetastore(RMFTestCase): self.assert_configure_secured() self.assert_init_schema('asd') self.assertResourceCalled('Execute', '/tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.err /var/run/hive/hive.pid /usr/hdp/current/hive-server2/conf/conf.server /var/log/hive', - environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client', - 'HIVE_BIN': 'hive', + environment = {'HIVE_CMD': '/usr/hdp/current/hive-server2/bin/hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 >/dev/null 2>&1", user = 'hive',
