AMBARI-7631 Hive Metastore doesn't start (dsen)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0329800f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0329800f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0329800f Branch: refs/heads/branch-alerts-dev Commit: 0329800f2ec0ae6d699a65cdb088327368e224c0 Parents: 6897128 Author: Dmytro Sen <[email protected]> Authored: Fri Oct 3 18:00:57 2014 +0300 Committer: Dmytro Sen <[email protected]> Committed: Fri Oct 3 18:00:57 2014 +0300 ---------------------------------------------------------------------- .../2.0.6/services/HIVE/package/scripts/hive.py | 30 +++++------ .../stacks/2.0.6/HIVE/test_hive_client.py | 16 +++--- .../stacks/2.0.6/HIVE/test_hive_metastore.py | 52 ++++++++++---------- .../stacks/2.0.6/HIVE/test_hive_server.py | 52 ++++++++++---------- .../stacks/2.1/HIVE/test_hive_metastore.py | 52 ++++++++++---------- 5 files changed, 101 insertions(+), 101 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0329800f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py index 67720e1..e388ee5 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py @@ -44,7 +44,21 @@ def hive(name=None): # The reason is that stale-configs are service-level, not component. for conf_dir in params.hive_conf_dirs_list: fill_conf_dir(conf_dir) - + + XmlConfig("hive-site.xml", + conf_dir=params.hive_config_dir, + configurations=params.config['configurations']['hive-site'], + configuration_attributes=params.config['configuration_attributes']['hive-site'], + owner=params.hive_user, + group=params.user_group, + mode=0644) + + File(format("{hive_config_dir}/hive-env.sh"), + owner=params.hive_user, + group=params.user_group, + content=InlineTemplate(params.hive_env_sh_template) + ) + if name == 'metastore' or name == 'hiveserver2': jdbc_connector() @@ -93,20 +107,6 @@ def hive(name=None): crt_directory(params.hive_log_dir) crt_directory(params.hive_var_lib) - XmlConfig("hive-site.xml", - conf_dir=params.hive_config_dir, - configurations=params.config['configurations']['hive-site'], - configuration_attributes=params.config['configuration_attributes']['hive-site'], - owner=params.hive_user, - group=params.user_group, - mode=0644) - - File(format("{hive_config_dir}/hive-env.sh"), - owner=params.hive_user, - group=params.user_group, - content=InlineTemplate(params.hive_env_sh_template) - ) - def fill_conf_dir(component_conf_dir): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/0329800f/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py index 796e820..d4c7b26 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py @@ -94,10 +94,6 @@ class TestHiveClient(RMFTestCase): group = 'hadoop', mode = 0644, ) - self.assertResourceCalled('Execute', '/bin/sh -c \'cd /usr/lib/ambari-agent/ && curl -kf -x "" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar -o DBConnectionVerification.jar\'', - environment = {'no_proxy': 'c6401.ambari.apache.org'}, - not_if = '[ -f DBConnectionVerification.jar]', - ) self.assertResourceCalled('XmlConfig', 'hive-site.xml', group = 'hadoop', conf_dir = '/etc/hive/conf', @@ -111,6 +107,10 @@ class TestHiveClient(RMFTestCase): owner = 'hive', group = 'hadoop', ) + self.assertResourceCalled('Execute', '/bin/sh -c \'cd /usr/lib/ambari-agent/ && curl -kf -x "" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar -o DBConnectionVerification.jar\'', + environment = {'no_proxy': 'c6401.ambari.apache.org'}, + not_if = '[ -f DBConnectionVerification.jar]', + ) self.assertNoMoreResources() @@ -187,10 +187,6 @@ class TestHiveClient(RMFTestCase): group = 'hadoop', mode = 0644, ) - self.assertResourceCalled('Execute', '/bin/sh -c \'cd /usr/lib/ambari-agent/ && curl -kf -x "" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar -o DBConnectionVerification.jar\'', - environment = {'no_proxy': 'c6401.ambari.apache.org'}, - not_if = '[ -f DBConnectionVerification.jar]', - ) self.assertResourceCalled('XmlConfig', 'hive-site.xml', group = 'hadoop', conf_dir = '/etc/hive/conf', @@ -204,4 +200,8 @@ class TestHiveClient(RMFTestCase): owner = 'hive', group = 'hadoop', ) + self.assertResourceCalled('Execute', '/bin/sh -c \'cd /usr/lib/ambari-agent/ && curl -kf -x "" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar -o DBConnectionVerification.jar\'', + environment = {'no_proxy': 'c6401.ambari.apache.org'}, + not_if = '[ -f DBConnectionVerification.jar]', + ) self.assertNoMoreResources() http://git-wip-us.apache.org/repos/asf/ambari/blob/0329800f/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 201b3f2..b608334 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 @@ -173,6 +173,19 @@ class TestHiveMetastore(RMFTestCase): group = 'hadoop', mode = 0644, ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', environment = {'PATH' : os.environ['PATH'] + os.pathsep + "/usr/lib/hive/bin" + os.pathsep + "/usr/bin"}, @@ -205,19 +218,6 @@ class TestHiveMetastore(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - ) def assert_configure_secured(self): self.assertResourceCalled('Directory', '/etc/hive/conf.server', @@ -286,6 +286,19 @@ class TestHiveMetastore(RMFTestCase): group = 'hadoop', mode = 0644, ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', path = ['/bin', '/usr/bin/'], @@ -318,16 +331,3 @@ class TestHiveMetastore(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - ) http://git-wip-us.apache.org/repos/asf/ambari/blob/0329800f/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 4fe131b..7d1f116 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 @@ -282,6 +282,19 @@ class TestHiveServer(RMFTestCase): group = 'hadoop', mode = 0644, ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', path = ['/bin', '/usr/bin/'], @@ -314,19 +327,6 @@ class TestHiveServer(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - ) def assert_configure_secured(self): self.assertResourceCalled('HdfsDirectory', '/apps/hive/warehouse', @@ -426,6 +426,19 @@ class TestHiveServer(RMFTestCase): group = 'hadoop', mode = 0644, ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', path = ['/bin', '/usr/bin/'], @@ -458,19 +471,6 @@ class TestHiveServer(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - ) @patch("hive_service.check_fs_root") @patch("time.time") http://git-wip-us.apache.org/repos/asf/ambari/blob/0329800f/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 12e7439..6f2c0b3 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 @@ -151,6 +151,19 @@ class TestHiveMetastore(RMFTestCase): owner = 'hive', group = 'hadoop', ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', path = ['/bin', '/usr/bin/'], @@ -186,19 +199,6 @@ class TestHiveMetastore(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - ) def assert_configure_secured(self): self.assertResourceCalled('Directory', '/etc/hive/conf.server', @@ -243,6 +243,19 @@ class TestHiveMetastore(RMFTestCase): owner = 'hive', group = 'hadoop', ) + self.assertResourceCalled('XmlConfig', 'hive-site.xml', + group = 'hadoop', + conf_dir = '/etc/hive/conf.server', + mode = 0644, + configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], + owner = 'hive', + configurations = self.getConfig()['configurations']['hive-site'], + ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', + content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), + owner = 'hive', + group = 'hadoop', + ) self.assertResourceCalled('Execute', 'hive mkdir -p /tmp/AMBARI-artifacts/ ; cp /usr/share/java/mysql-connector-java.jar /usr/lib/hive/lib//mysql-connector-java.jar', creates = '/usr/lib/hive/lib//mysql-connector-java.jar', path = ['/bin', '/usr/bin/'], @@ -278,16 +291,3 @@ class TestHiveMetastore(RMFTestCase): mode = 0755, recursive = True, ) - self.assertResourceCalled('XmlConfig', 'hive-site.xml', - group = 'hadoop', - conf_dir = '/etc/hive/conf.server', - mode = 0644, - configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'], - owner = 'hive', - configurations = self.getConfig()['configurations']['hive-site'], - ) - self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh', - content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']), - owner = 'hive', - group = 'hadoop', - )
