Add list of open ports for Cloudera plugin

It's needed for correct working auto security groups

Changes:
* add ports
* enable auto security groups in integration tests

Closes-bug: #1391520
(cherry picked from commit 8641100c54)

Change-Id: Ia16d61e533831d1ec6827db76959092cd1f77e26
This commit is contained in:
Sergey Reshetnyak 2014-11-12 14:07:45 +03:00 committed by Nikita Konovalov
parent 945fa72ed0
commit 6e4e7e62d9
4 changed files with 37 additions and 2 deletions

View File

@ -384,3 +384,29 @@ def start_cluster(cluster):
cu.create_oozie_db(oozie)
cu.install_oozie_sharelib(oozie)
cu.start_service(oozie)
def get_open_ports(node_group):
ports = [9000] # for CM agent
ports_map = {
'MANAGER': [7180, 7182, 7183, 7432, 7184, 8084, 8086, 10101,
9997, 9996, 8087, 9998, 9999, 8085, 9995, 9994],
'NAMENODE': [8020, 8022, 50070, 50470],
'SECONDARYNAMENODE': [50090, 50495],
'DATANODE': [50010, 1004, 50075, 1006, 50020],
'RESOURCEMANAGER': [8030, 8031, 8032, 8033, 8088],
'NODEMANAGER': [8040, 8041, 8042],
'JOBHISTORY': [10020, 19888],
'HIVEMETASTORE': [9083],
'HIVESERVER2': [10000],
'HUE_SERVER': [8888],
'OOZIE_SERVER': [11000, 11001],
'SPARK_YARN_HISTORY_SERVER': [18088]
}
for process in node_group.node_processes:
if process in ports_map:
ports.extend(ports_map[process])
return ports

View File

@ -93,3 +93,6 @@ class CDHPluginProvider(p.ProvisioningPluginBase):
if job_type in edp_engine.EdpOozieEngine.get_supported_job_types():
return edp_engine.EdpOozieEngine(cluster)
return None
def get_open_ports(self, node_group):
return dp.get_open_ports(node_group)

View File

@ -143,11 +143,11 @@ class ITestCase(testcase.WithAttributes, base.BaseTestCase):
def create_node_group_template(self, name, plugin_config, description,
node_processes, node_configs,
volumes_per_node=0, volume_size=0,
floating_ip_pool=None):
floating_ip_pool=None, **kwargs):
data = self.sahara.node_group_templates.create(
name, plugin_config.PLUGIN_NAME, plugin_config.HADOOP_VERSION,
self.flavor_id, description, volumes_per_node, volume_size,
node_processes, node_configs, floating_ip_pool)
node_processes, node_configs, floating_ip_pool, **kwargs)
node_group_template_id = data.id
return node_group_template_id

View File

@ -69,6 +69,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'description': 'test node group template for CDH plugin',
'node_processes': ['NODEMANAGER', 'DATANODE'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'node_configs': {}
}
self.ng_tmpl_nm_dn_id = self.create_node_group_template(**template)
@ -84,6 +85,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'volume_size': self.volume_size,
'node_processes': ['NODEMANAGER'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'node_configs': {}
}
self.ng_tmpl_nm_id = self.create_node_group_template(**template)
@ -99,6 +101,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'volume_size': self.volume_size,
'node_processes': ['DATANODE'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'node_configs': {}
}
self.ng_tmpl_dn_id = self.create_node_group_template(**template)
@ -128,6 +131,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'flavor_id': self.cdh_config.MANAGERNODE_FLAVOR,
'node_processes': ['MANAGER'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'count': 1
},
{
@ -135,6 +139,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'flavor_id': self.flavor_id,
'node_processes': ['NAMENODE', 'RESOURCEMANAGER'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'count': 1
},
{
@ -143,6 +148,7 @@ class CDHGatingTest(cluster_configs.ClusterConfigTest,
'node_processes': ['OOZIE_SERVER', 'JOBHISTORY',
'SECONDARYNAMENODE'],
'floating_ip_pool': self.floating_ip_pool,
'auto_security_group': True,
'count': 1
},
{