You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rk...@apache.org on 2017/01/23 06:25:13 UTC
[1/2] ambari git commit: AMBARI-19627 Cannot start Zeppelin notebook
if Hive is not installed (r-kamath)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 f06dcd7bc -> 8396f27b7
refs/heads/trunk 2463b0a26 -> f4a3dbcbc
AMBARI-19627 Cannot start Zeppelin notebook if Hive is not installed (r-kamath)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8396f27b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8396f27b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8396f27b
Branch: refs/heads/branch-2.5
Commit: 8396f27b732a98a93c6f63ed3f471c684f6eb70e
Parents: f06dcd7
Author: Renjith Kamath <re...@gmail.com>
Authored: Mon Jan 23 11:48:17 2017 +0530
Committer: Renjith Kamath <re...@gmail.com>
Committed: Mon Jan 23 11:48:17 2017 +0530
----------------------------------------------------------------------
.../ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/8396f27b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index b609538..9af48e5 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -151,11 +151,13 @@ class Master(Script):
owner=params.zeppelin_user, group=params.zeppelin_group)
# copy hive-site.xml only if Spark 1.x is installed
- if 'spark-defaults' in params.config['configurations']:
+ if 'spark-defaults' in params.config['configurations'] and \
+ os.path.exists("/etc/spark/conf/hive-site.xml"):
File(format("{params.conf_dir}/hive-site.xml"), content=StaticFile("/etc/spark/conf/hive-site.xml"),
owner=params.zeppelin_user, group=params.zeppelin_group)
- if len(params.hbase_master_hosts) > 0:
+ if len(params.hbase_master_hosts) > 0 and \
+ os.path.exists("/etc/hbase/conf/hbase-site.xml"):
# copy hbase-site.xml
File(format("{params.conf_dir}/hbase-site.xml"), content=StaticFile("/etc/hbase/conf/hbase-site.xml"),
owner=params.zeppelin_user, group=params.zeppelin_group)
[2/2] ambari git commit: AMBARI-19627 Cannot start Zeppelin notebook
if Hive is not installed (Attila Doroszlai via r-kamath)
Posted by rk...@apache.org.
AMBARI-19627 Cannot start Zeppelin notebook if Hive is not installed (Attila Doroszlai via r-kamath)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f4a3dbcb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f4a3dbcb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f4a3dbcb
Branch: refs/heads/trunk
Commit: f4a3dbcbce0efe4b741a63277338b813ab52ae5c
Parents: 2463b0a
Author: Renjith Kamath <re...@gmail.com>
Authored: Mon Jan 23 11:51:38 2017 +0530
Committer: Renjith Kamath <re...@gmail.com>
Committed: Mon Jan 23 11:53:43 2017 +0530
----------------------------------------------------------------------
.../0.6.0.2.5/package/scripts/master.py | 6 +-
.../stacks/2.5/ZEPPELIN/test_zeppelin_master.py | 129 ++-----------------
2 files changed, 17 insertions(+), 118 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f4a3dbcb/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index b609538..9af48e5 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -151,11 +151,13 @@ class Master(Script):
owner=params.zeppelin_user, group=params.zeppelin_group)
# copy hive-site.xml only if Spark 1.x is installed
- if 'spark-defaults' in params.config['configurations']:
+ if 'spark-defaults' in params.config['configurations'] and \
+ os.path.exists("/etc/spark/conf/hive-site.xml"):
File(format("{params.conf_dir}/hive-site.xml"), content=StaticFile("/etc/spark/conf/hive-site.xml"),
owner=params.zeppelin_user, group=params.zeppelin_group)
- if len(params.hbase_master_hosts) > 0:
+ if len(params.hbase_master_hosts) > 0 and \
+ os.path.exists("/etc/hbase/conf/hbase-site.xml"):
# copy hbase-site.xml
File(format("{params.conf_dir}/hbase-site.xml"), content=StaticFile("/etc/hbase/conf/hbase-site.xml"),
owner=params.zeppelin_user, group=params.zeppelin_group)
http://git-wip-us.apache.org/repos/asf/ambari/blob/f4a3dbcb/ambari-server/src/test/python/stacks/2.5/ZEPPELIN/test_zeppelin_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/ZEPPELIN/test_zeppelin_master.py b/ambari-server/src/test/python/stacks/2.5/ZEPPELIN/test_zeppelin_master.py
index 2578316..bd0f5ef 100644
--- a/ambari-server/src/test/python/stacks/2.5/ZEPPELIN/test_zeppelin_master.py
+++ b/ambari-server/src/test/python/stacks/2.5/ZEPPELIN/test_zeppelin_master.py
@@ -131,7 +131,9 @@ class TestZeppelinMaster(RMFTestCase):
group = 'zeppelin',
)
- def test_configure_default(self):
+ @patch('os.path.exists')
+ def test_configure_default(self, os_path_exists_mock):
+ os_path_exists_mock.side_effect = lambda path: path == '/etc/spark/conf/hive-site.xml'
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/master.py",
classname = "Master",
command = "configure",
@@ -142,7 +144,9 @@ class TestZeppelinMaster(RMFTestCase):
self.assert_configure_default()
self.assertNoMoreResources()
- def test_configure_secured(self):
+ @patch('os.path.exists')
+ def test_configure_secured(self, os_path_exists_mock):
+ os_path_exists_mock.side_effect = lambda path: path == '/etc/spark/conf/hive-site.xml'
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/master.py",
classname = "Master",
command = "configure",
@@ -199,116 +203,9 @@ class TestZeppelinMaster(RMFTestCase):
)
self.assertNoMoreResources()
-
- def test_start_secured(self):
- self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/master.py",
- classname = "Master",
- command = "start",
- config_file = "secured.json",
- stack_version = self.STACK_VERSION,
- target = RMFTestCase.TARGET_COMMON_SERVICES
- )
- self.assert_configure_secured()
- self.assertResourceCalled('Execute', ('chown', '-R', u'zeppelin:zeppelin', '/etc/zeppelin'),
- sudo = True,
- )
- self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/zeppelin.server.kerberos.keytab zeppelin@EXAMPLE.COM; ',
- user = 'zeppelin',
- )
- self.assertResourceCalled('HdfsResource', '/user/zeppelin',
- security_enabled = True,
- hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
- keytab = UnknownConfigurationMock(),
- default_fs = 'hdfs://c6401.ambari.apache.org:8020',
- hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
- hdfs_site = {u'a': u'b'},
- kinit_path_local = '/usr/bin/kinit',
- principal_name = UnknownConfigurationMock(),
- user = 'hdfs',
- owner = 'zeppelin',
- recursive_chown = True,
- hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
- type = 'directory',
- action = ['create_on_execute'],
- recursive_chmod = True,
- )
- self.assertResourceCalled('HdfsResource', '/user/zeppelin/test',
- security_enabled = True,
- hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
- keytab = UnknownConfigurationMock(),
- default_fs = 'hdfs://c6401.ambari.apache.org:8020',
- hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
- hdfs_site = {u'a': u'b'},
- kinit_path_local = '/usr/bin/kinit',
- principal_name = UnknownConfigurationMock(),
- user = 'hdfs',
- owner = 'zeppelin',
- recursive_chown = True,
- hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
- type = 'directory',
- action = ['create_on_execute'],
- recursive_chmod = True,
- )
- self.assertResourceCalled('HdfsResource', '/apps/zeppelin',
- security_enabled = True,
- hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
- keytab = UnknownConfigurationMock(),
- default_fs = 'hdfs://c6401.ambari.apache.org:8020',
- hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
- hdfs_site = {u'a': u'b'},
- kinit_path_local = '/usr/bin/kinit',
- principal_name = UnknownConfigurationMock(),
- user = 'hdfs',
- owner = 'zeppelin',
- recursive_chown = True,
- hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
- type = 'directory',
- action = ['create_on_execute'],
- recursive_chmod = True,
- )
- self.assertResourceCalled('HdfsResource', '/apps/zeppelin/tmp',
- security_enabled = True,
- hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
- keytab = UnknownConfigurationMock(),
- source = '/tmp',
- default_fs = 'hdfs://c6401.ambari.apache.org:8020',
- replace_existing_files = True,
- hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
- hdfs_site = {u'a': u'b'},
- kinit_path_local = '/usr/bin/kinit',
- principal_name = UnknownConfigurationMock(),
- user = 'hdfs',
- owner = 'zeppelin',
- group = 'zeppelin',
- hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
- type = 'file',
- action = ['create_on_execute'],
- mode = 0444,
- )
- self.assertResourceCalled('HdfsResource', None,
- security_enabled = True,
- hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
- keytab = UnknownConfigurationMock(),
- default_fs = 'hdfs://c6401.ambari.apache.org:8020',
- hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
- hdfs_site = {u'a': u'b'},
- kinit_path_local = '/usr/bin/kinit',
- principal_name = UnknownConfigurationMock(),
- user = 'hdfs',
- action = ['execute'],
- hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
- )
- self.assertResourceCalled('File', '/etc/zeppelin/conf/interpreter.json',
- content = '{\n "interpreterSettings": []\n}',
- owner = 'zeppelin',
- group = 'zeppelin',
- )
- self.assertResourceCalled('Execute', '/usr/hdp/current/zeppelin-server/bin/zeppelin-daemon.sh restart >> /var/log/zeppelin/zeppelin-setup.log',
- user = 'zeppelin',
- )
- self.assertNoMoreResources()
-
- def test_start_default(self):
+ @patch('os.path.exists')
+ def test_start_default(self, os_path_exists_mock):
+ os_path_exists_mock.side_effect = lambda path: path == '/etc/spark/conf/hive-site.xml'
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/master.py",
classname = "Master",
command = "start",
@@ -320,7 +217,9 @@ class TestZeppelinMaster(RMFTestCase):
self.assertResourceCalled('Execute', ('chown', '-R', u'zeppelin:zeppelin', '/etc/zeppelin'),
sudo = True,
)
- def test_start_secured(self):
+
+ @patch('os.path.exists', return_value = True)
+ def test_start_secured(self, os_path_exists_mock):
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/master.py",
classname = "Master",
command = "start",
@@ -430,6 +329,4 @@ class TestZeppelinMaster(RMFTestCase):
user = 'zeppelin',
)
self.assertNoMoreResources()
-
-
-
\ No newline at end of file
+