@@ -523,7 +523,11 @@ def remote_host_detection():
523
523
524
524
except :
525
525
pass
526
- print ('\t %d found' % len (host_fqdn_list ))
526
+ if len (host_fqdn_list ) < 1 :
527
+ print ('\t Cloudera Manager host not found!' )
528
+ sys .exit ()
529
+ else :
530
+ print ('\t %d found' % len (host_fqdn_list ))
527
531
# Master Host Detection
528
532
x = 1
529
533
print ('->Lookup Master Hosts FQDN' )
@@ -541,7 +545,11 @@ def remote_host_detection():
541
545
host_ip_list .append (fqdn [3 ])
542
546
543
547
else :
544
- print ('\t %d found' % (x - 1 ))
548
+ if (x - 1 ) < 2 :
549
+ print ('\t %d Master hosts found, minimum 2 required!' % (x - 1 ))
550
+ sys .exit ()
551
+ else :
552
+ print ('\t %d found' % (x - 1 ))
545
553
x = 0
546
554
547
555
except :
@@ -571,7 +579,11 @@ def remote_host_detection():
571
579
host_ip_list .append (fqdn [3 ])
572
580
573
581
else :
574
- print ('\t %d found' % (x - 1 ))
582
+ if (x - 1 ) < 3 :
583
+ print ('\t %d Workers found, minimum 3 required!' % (x - 1 ))
584
+ sys .exit ()
585
+ else :
586
+ print ('\t %d found' % (x - 1 ))
575
587
x = 0
576
588
577
589
except :
@@ -1172,7 +1184,7 @@ def push_rcg_config(config):
1172
1184
for service in cluster_service_list :
1173
1185
build_role_config_group_list (service )
1174
1186
message = 'Cluster Build Update'
1175
- print ('->Updating ' + service + ' Configuration\n ' )
1187
+ print ('->Updating ' + service + ' Configuration' )
1176
1188
if service == 'FLUME' :
1177
1189
for rcg in role_config_group_list :
1178
1190
if rcg == 'FLUME-AGENT-BASE' :
@@ -1746,7 +1758,7 @@ def create_role(rcg, rcg_roletype, service, host_id, hostname, rc):
1746
1758
role_api_packet = [cm_client .ApiRole (name = role_name , type = rcg_roletype , host_ref = host_ref ,
1747
1759
role_config_group_ref = role_config_group_ref , service_ref = service_ref )]
1748
1760
body = cm_client .ApiRoleList (role_api_packet )
1749
- print ('->Creating Role %s for %s' % (role_name , hostname ))
1761
+ print ('--- >Creating Role %s for %s' % (role_name , hostname ))
1750
1762
1751
1763
try :
1752
1764
api_response = roles_api .create_roles (cluster_name , service , body = body )
@@ -2362,6 +2374,25 @@ def generate_kerberos_credentials():
2362
2374
print ('Exception calling ClouderaManagerResourceApi->generate_credentials_command: {}' .format (e ))
2363
2375
2364
2376
2377
+ def hdfs_enable_ha ():
2378
+ """
2379
+ Enable high availability (HA) for an HDFS NameNode.
2380
+
2381
+ The command will set up the given "active" and "stand-by" NameNodes as an HA pair. Both nodes need to already exist.
2382
+
2383
+ If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted.
2384
+
2385
+ Note that while the shared edits path may be different for both nodes,
2386
+ they need to point to the same underlying storage
2387
+
2388
+ As part of enabling HA, any services that depend on the HDFS service being modified will be stopped.
2389
+ The command arguments provide options to re-start these services and to re-deploy the client configurations for
2390
+ services of the cluster after HA has been enabled.
2391
+ :return:
2392
+ """
2393
+
2394
+
2395
+
2365
2396
#
2366
2397
# END SECONDARY FUNCTIONS
2367
2398
#
@@ -2443,6 +2474,9 @@ def build_cloudera_cluster():
2443
2474
if input_host_list == 'None' :
2444
2475
print ('->No input host list found, running remote detection via SSH' )
2445
2476
remote_host_detection ()
2477
+ if len (host_fqdn_list ) < 6 :
2478
+ print ('Error - %d hosts found, Minimum 6 required to build %s!' % (len (host_fqdn_list ), cluster_name ))
2479
+ sys .exit ()
2446
2480
2447
2481
else :
2448
2482
print ('->Input host list found: %s' % input_host_list )
0 commit comments