Merge "forbid cluster creation without secondarynamenode"
This commit is contained in:
commit
75a54004c5
@ -53,6 +53,7 @@ def _check_ambari(cluster):
|
|||||||
def _check_hdfs(cluster):
|
def _check_hdfs(cluster):
|
||||||
nn_count = utils.get_instances_count(cluster, common.NAMENODE)
|
nn_count = utils.get_instances_count(cluster, common.NAMENODE)
|
||||||
dn_count = utils.get_instances_count(cluster, common.DATANODE)
|
dn_count = utils.get_instances_count(cluster, common.DATANODE)
|
||||||
|
snn_count = utils.get_instances_count(cluster, common.SECONDARY_NAMENODE)
|
||||||
|
|
||||||
if cluster.cluster_configs.get("general", {}).get(common.NAMENODE_HA):
|
if cluster.cluster_configs.get("general", {}).get(common.NAMENODE_HA):
|
||||||
_check_zk_ha(cluster)
|
_check_zk_ha(cluster)
|
||||||
@ -65,6 +66,11 @@ def _check_hdfs(cluster):
|
|||||||
if nn_count != 1:
|
if nn_count != 1:
|
||||||
raise ex.InvalidComponentCountException(common.NAMENODE, 1,
|
raise ex.InvalidComponentCountException(common.NAMENODE, 1,
|
||||||
nn_count)
|
nn_count)
|
||||||
|
|
||||||
|
if snn_count != 1:
|
||||||
|
raise ex.InvalidComponentCountException(common.SECONDARY_NAMENODE,
|
||||||
|
1, snn_count)
|
||||||
|
|
||||||
if dn_count == 0:
|
if dn_count == 0:
|
||||||
raise ex.InvalidComponentCountException(
|
raise ex.InvalidComponentCountException(
|
||||||
common.DATANODE, _("1 or more"), dn_count)
|
common.DATANODE, _("1 or more"), dn_count)
|
||||||
|
@ -47,7 +47,8 @@ class AmbariValidationTestCase(base.SaharaTestCase):
|
|||||||
p_common.RESOURCEMANAGER,
|
p_common.RESOURCEMANAGER,
|
||||||
p_common.NODEMANAGER,
|
p_common.NODEMANAGER,
|
||||||
p_common.HISTORYSERVER,
|
p_common.HISTORYSERVER,
|
||||||
p_common.APP_TIMELINE_SERVER]})
|
p_common.APP_TIMELINE_SERVER,
|
||||||
|
p_common.SECONDARY_NAMENODE]})
|
||||||
cluster.cluster_configs = {"general": {}}
|
cluster.cluster_configs = {"general": {}}
|
||||||
with mock.patch("sahara.plugins.ambari.validation.conductor") as p:
|
with mock.patch("sahara.plugins.ambari.validation.conductor") as p:
|
||||||
p.cluster_get = mock.Mock()
|
p.cluster_get = mock.Mock()
|
||||||
|
Loading…
Reference in New Issue
Block a user