@@ -648,7 +648,7 @@ def build_cluster_host_list(host_fqdn_list):
648
648
print ('Cluster Host List: %s' % cluster_host_list )
649
649
650
650
651
- def build_disk_lists (disk_count , data_tiering ):
651
+ def build_disk_lists (disk_count , data_tiering , nvme_disks ):
652
652
"""
653
653
Build Disk Lists for use with HDFS and YARN
654
654
:return:
@@ -2374,23 +2374,24 @@ def generate_kerberos_credentials():
2374
2374
print ('Exception calling ClouderaManagerResourceApi->generate_credentials_command: {}' .format (e ))
2375
2375
2376
2376
2377
- def hdfs_enable_ha ():
2377
+ def update_license ():
2378
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.
2379
+ Update Cloudera Manager License
2391
2380
:return:
2392
2381
"""
2393
-
2382
+ try :
2383
+ with open (license_file ) as l :
2384
+ body = l .read ()
2385
+ try :
2386
+ api_response = cloudera_manager_api .update_license (body = body )
2387
+ if debug == 'True' :
2388
+ pprint (api_response )
2389
+ except ApiException as e :
2390
+ print ('Exception calling Cloudera Manager Resource API -> update_license {}' .format (e ))
2391
+ except :
2392
+ print ('License file %s not found!' % license_file )
2393
+ print ('Using Trial License instead...' )
2394
+ begin_trial ()
2394
2395
2395
2396
2396
2397
#
@@ -2437,6 +2438,16 @@ def options_parser(args=None):
2437
2438
print ('Worker Shape is required.' )
2438
2439
parser .print_help ()
2439
2440
exit (- 1 )
2441
+ if options .license_file :
2442
+ try :
2443
+ with open (options .license_file ) as l :
2444
+ license = l .read ()
2445
+ if debug == 'True' :
2446
+ print ('License File Info:\n %s' % license )
2447
+ except :
2448
+ print ('Cannot open license file, verify file exists and full path used: %s' % options .license_file )
2449
+ sys .exit ()
2450
+
2440
2451
return (options .cm_server , options .input_host_list , options .disk_count , options .license_file , options .worker_shape ,
2441
2452
options .BUILD , options .DELETE )
2442
2453
@@ -2451,7 +2462,7 @@ def build_cloudera_cluster():
2451
2462
:return:
2452
2463
"""
2453
2464
parse_ssh_key ()
2454
- build_disk_lists (disk_count , data_tiering )
2465
+ build_disk_lists (disk_count , data_tiering , nvme_disks )
2455
2466
try :
2456
2467
api_response = users_api .read_user2 (admin_user_name )
2457
2468
if api_response .auth_roles :
@@ -2534,8 +2545,11 @@ def build_cloudera_cluster():
2534
2545
print ('->Restart MGMT Roles' )
2535
2546
mgmt_role_commands (action = 'restart_command' )
2536
2547
# TODO - Need to refactor here if license is provided
2537
- print ('->Activating Trial License' )
2538
- begin_trial ()
2548
+ if license_file == 'None' :
2549
+ print ('->Activating Trial License' )
2550
+ begin_trial ()
2551
+ else :
2552
+ update_license ()
2539
2553
print ('->Executing first_run on Cluster - %s' % cluster_name )
2540
2554
try :
2541
2555
api_response = clusters_api .first_run (cluster_name )
0 commit comments