Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 8cc5daf

Browse files
committed
Fix for NN RCG
1 parent a006b34 commit 8cc5daf

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

v6/scripts/deploy_on_oci.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,6 @@ def push_rcg_config(config):
11911191
print('-->Updating RCG: %s' % rcg)
11921192
rcg_roletype = 'AGENT'
11931193
create_role(rcg, rcg_roletype, service, cm_host_id, cm_hostname, 3)
1194-
pass
11951194

11961195
if service == 'HBASE':
11971196
for rcg in role_config_group_list:
@@ -1243,7 +1242,7 @@ def push_rcg_config(config):
12431242
namenode_java_heapsize, namenode_log_dir, dfs_namenode_servicerpc_address]
12441243
for config in nn_config_list:
12451244
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)
12471246

12481247
if rcg == 'HDFS-DATANODE-BASE':
12491248
print('-->Updating RCG: %s' % rcg)
@@ -1331,7 +1330,6 @@ def push_rcg_config(config):
13311330
create_role(rcg, rcg_roletype, service, nn_host_id, nn_hostname, 1)
13321331
create_role(rcg, rcg_roletype, service, snn_host_id, snn_hostname, 2)
13331332
create_role(rcg, rcg_roletype, service, cm_host_id, cm_hostname, 3)
1334-
pass
13351333

13361334
if service == 'HIVE':
13371335
for rcg in role_config_group_list:
@@ -2394,6 +2392,21 @@ def update_license():
23942392
begin_trial()
23952393

23962394

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+
23972410
#
23982411
# END SECONDARY FUNCTIONS
23992412
#
@@ -2701,6 +2714,7 @@ def enable_kerberos():
27012714
pprint(cluster_host_list)
27022715
print('->Full Deployment Follows')
27032716
get_deployment_full()
2717+
27042718
else:
27052719
print('Cluster Check returned null: %s' % cluster_exists)
27062720
else:

0 commit comments

Comments
 (0)