@@ -1191,7 +1191,6 @@ def push_rcg_config(config):
1191
1191
print ('-->Updating RCG: %s' % rcg )
1192
1192
rcg_roletype = 'AGENT'
1193
1193
create_role (rcg , rcg_roletype , service , cm_host_id , cm_hostname , 3 )
1194
- pass
1195
1194
1196
1195
if service == 'HBASE' :
1197
1196
for rcg in role_config_group_list :
@@ -1243,7 +1242,7 @@ def push_rcg_config(config):
1243
1242
namenode_java_heapsize , namenode_log_dir , dfs_namenode_servicerpc_address ]
1244
1243
for config in nn_config_list :
1245
1244
push_rcg_config (config )
1246
- create_role (rcg , rcg_roletype , service , snn_host_id , snn_hostname , 1 )
1245
+ create_role (rcg , rcg_roletype , service , snn_host_id , nn_hostname , 1 )
1247
1246
1248
1247
if rcg == 'HDFS-DATANODE-BASE' :
1249
1248
print ('-->Updating RCG: %s' % rcg )
@@ -1331,7 +1330,6 @@ def push_rcg_config(config):
1331
1330
create_role (rcg , rcg_roletype , service , nn_host_id , nn_hostname , 1 )
1332
1331
create_role (rcg , rcg_roletype , service , snn_host_id , snn_hostname , 2 )
1333
1332
create_role (rcg , rcg_roletype , service , cm_host_id , cm_hostname , 3 )
1334
- pass
1335
1333
1336
1334
if service == 'HIVE' :
1337
1335
for rcg in role_config_group_list :
@@ -2394,6 +2392,21 @@ def update_license():
2394
2392
begin_trial ()
2395
2393
2396
2394
2395
+ def hdfs_enable_nn_ha (nn_hostname , snn_hostname , snn_host_id ):
2396
+ """
2397
+ Enable High Availability (HA) with Automatic Failover for an HDFS NameNode.
2398
+ :return:
2399
+ """
2400
+ body = cm_client .ApiEnableNnHaArguments (active_nn_name = nn_hostname , standby_nn_name = snn_hostname ,
2401
+ standby_nn_host_id = snn_host_id )
2402
+ try :
2403
+ api_response = services_api .hdfs_enable_nn_ha_command (cluster_name , 'HDFS' , body = body )
2404
+ if debug == 'True' :
2405
+ pprint (api_response )
2406
+ except ApiException as e :
2407
+ print ('Exception calling ServicesResourceApi -> hdfs_enable_ha_command {}' .format (e ))
2408
+
2409
+
2397
2410
#
2398
2411
# END SECONDARY FUNCTIONS
2399
2412
#
@@ -2701,6 +2714,7 @@ def enable_kerberos():
2701
2714
pprint (cluster_host_list )
2702
2715
print ('->Full Deployment Follows' )
2703
2716
get_deployment_full ()
2717
+
2704
2718
else :
2705
2719
print ('Cluster Check returned null: %s' % cluster_exists )
2706
2720
else :
0 commit comments