Add HBASE MASTER processes number validation

Because of the missing HBASE MASTER process number validation
during cluster creation, it takes too long for sahara to raise
the error too many HBASE MASTER processes.

Closes-Bug: #1656869

Change-Id: Id143eb2360366443a630f65fc6261231b562417c
This commit is contained in:
Rafik 2017-01-16 16:49:17 +01:00
parent bfb7e7368c
commit 3d63bdc9b4

View File

@ -159,13 +159,16 @@ class Validator(object):
hbr_count = cls._get_inst_count(cluster, 'HBASE_REGIONSERVER')
zk_count = cls._get_inst_count(cluster, 'ZOOKEEPER_SERVER')
if hbm_count >= 1:
if hbm_count == 1:
if zk_count < 1:
raise ex.RequiredServiceMissingException(
'ZOOKEEPER', required_by='HBASE')
if hbr_count < 1:
raise ex.InvalidComponentCountException(
'HBASE_REGIONSERVER', _('at least 1'), hbr_count)
elif hbm_count > 1:
raise ex.InvalidComponentCountException('HBASE_MASTER',
_('0 or 1'), hbm_count)
elif hbr_count >= 1:
raise ex.InvalidComponentCountException('HBASE_MASTER',
_('at least 1'), hbm_count)