31
31
input_host_list = 'None'
32
32
license_file = 'None'
33
33
host_fqdn_list = []
34
+ # Data Tiering - Enabled when using Heterogenous storage in your cluster, automatically turns on if using DenseIO shapes
35
+ # and a Block Volume count greater than 0. Defaults to 'False"
36
+ data_tiering = 'False'
37
+ nvme_disks = 0
34
38
35
39
#
36
40
# Custom Global Parameters - Customize below here
72
76
# For Postgres this is 5432
73
77
meta_db_port = '3306'
74
78
75
- # Data Tiering - set this to 'True' if you wish to use Heterogenous storage in your cluster.
76
- # This enables mixing local storage and Block Volumes to achieve higher HDFS capacity
77
- data_tiering = 'False'
78
-
79
79
# Define Remote Parcel URL & Distribution Rate if desired
80
80
remote_parcel_url = 'https://archive.cloudera.com/cdh6/' + cluster_version + '/parcels' # type: str
81
81
parcel_distribution_rate = "1024000" # type: int
@@ -636,7 +636,7 @@ def build_cluster_host_list(host_fqdn_list):
636
636
print ('Cluster Host List: %s' % cluster_host_list )
637
637
638
638
639
- def build_disk_lists ():
639
+ def build_disk_lists (disk_count , data_tiering ):
640
640
"""
641
641
Build Disk Lists for use with HDFS and YARN
642
642
:return:
@@ -645,7 +645,23 @@ def build_disk_lists():
645
645
dfs_data_dir_list = ''
646
646
global yarn_data_dir_list
647
647
yarn_data_dir_list = ''
648
+ if 'DenseIO' in worker_shape :
649
+ if int (disk_count ) >= 1 :
650
+ data_tiering = 'True'
651
+ if worker_shape == 'BM.DenseIO2.52' :
652
+ nvme_disks = 8
653
+ if worker_shape == 'VM.DenseIO2.24' :
654
+ nvme_disks = 4
655
+ if worker_shape == 'VM.DenseIO2.16' :
656
+ nvme_disks = 2
657
+ if worker_shape == 'VM.DenseIO2.8' :
658
+ nvme_disks = 1
659
+ if worker_shape == 'BM.HPC2.36' :
660
+ nvme_disks = 1
661
+
648
662
if data_tiering == 'False' :
663
+ if nvme_disks >= 1 :
664
+ disk_count = nvme_disks
649
665
for x in range (0 , int (disk_count )):
650
666
if x is 0 :
651
667
dfs_data_dir_list += "/data%d/dfs/dn" % x
@@ -654,37 +670,18 @@ def build_disk_lists():
654
670
dfs_data_dir_list += ",/data%d/dfs/dn" % x
655
671
yarn_data_dir_list += ",/data%d/yarn/nm" % x
656
672
657
- elif data_tiering == 'True' :
658
- global local_disks
659
- if worker_shape == 'BM.DenseIO2.52' :
660
- local_disks = 8
661
-
662
- if worker_shape == 'VM.DenseIO2.24' :
663
- local_disks = 4
664
-
665
- if worker_shape == 'VM.DenseIO2.16' :
666
- local_disks = 2
667
-
668
- if worker_shape == 'VM.DenseIO2.8' :
669
- local_disks = 1
670
-
671
- if worker_shape == 'BM.HPC2.36' :
672
- local_disks = 1
673
-
674
- total_disk_count = disk_count + local_disks
673
+ if data_tiering == 'True' :
674
+ total_disk_count = int (disk_count ) + nvme_disks
675
675
for x in range (0 , int (total_disk_count )):
676
676
if x is 0 :
677
677
dfs_data_dir_list += "[DISK]/data%d/dfs/dn" % x
678
- elif x < local_disks :
678
+ yarn_data_dir_list += "/data%d/yarn/nm" % x
679
+ elif x < nvme_disks :
679
680
dfs_data_dir_list += ",[DISK]/data%d/dfs/dn" % x
680
681
else :
681
682
dfs_data_dir_list += ",[ARCHIVE]/data%d/dfs/dn" % x
682
683
yarn_data_dir_list += ",/data%d/yarn/nm" % x
683
684
684
- else :
685
- print ('Invalid Data Tiering flag - expected True or False: %s\n ' % data_tiering )
686
- sys .exit ()
687
-
688
685
689
686
def add_hosts_to_cluster (cluster_host_list ):
690
687
"""
@@ -2423,7 +2420,7 @@ def build_cloudera_cluster():
2423
2420
:return:
2424
2421
"""
2425
2422
parse_ssh_key ()
2426
- build_disk_lists ()
2423
+ build_disk_lists (disk_count , data_tiering )
2427
2424
try :
2428
2425
api_response = users_api .read_user2 (admin_user_name )
2429
2426
if api_response .auth_roles :
0 commit comments