34
34
data_tiering = 'False'
35
35
nvme_disks = 0
36
36
cluster_version = '6.2.0' # type: str
37
- simple_deployment = 'False ' # type: bool
37
+ deployment_type = 'simple ' # type: str
38
38
39
39
#
40
40
# Custom Global Parameters - Customize below here
52
52
cluster_name = 'TestCluster' # type: str
53
53
54
54
# Set this to 'True' (default) to enable secure cluster (Kerberos) functionality
55
- # Set this to 'False" to deploy an insecure cluster - This is automatically off for simple_deployment
55
+ # Set this to 'False" to deploy an insecure cluster - This is automatically off for simple deployment
56
56
secure_cluster = 'True' # type: bool
57
57
58
58
# Set this to 'False' if you do not want HDFS HA - useful for Development or if you want to save some setup time
59
- # This is automatically off for simple_deployment
59
+ # This is automatically off for simple deployment
60
60
hdfs_ha = 'True' # type: bool
61
61
62
62
# They should match what is in the Cloudera Manager CloudInit bootstrap file and instance boot files
@@ -2085,7 +2085,7 @@ def options_parser(args=None):
2085
2085
'OCI using cm_client with Cloudera '
2086
2086
'Manager API %s' % (cluster_version ,
2087
2087
api_version ))
2088
- parser .add_argument ('-S ' , '--simple_deployment ' , action = 'store_true ' , help = 'Simple , no HA or Kerberos at deployment' )
2088
+ parser .add_argument ('-D ' , '--deployment_type ' , metavar = 'deployment_type ' , help = 'simple , no HA or Kerberos at deployment, or secure to enable both ' )
2089
2089
parser .add_argument ('-m' , '--cm_server' , metavar = 'cm_server' , required = 'True' ,
2090
2090
help = 'Cloudera Manager IP to connect API using cm_client' )
2091
2091
parser .add_argument ('-i' , '--input_host_list' , metavar = 'input_host_list' ,
@@ -2099,6 +2099,7 @@ def options_parser(args=None):
2099
2099
parser .add_argument ('-n' , '--num_workers' , metavar = 'num_workers' , help = 'Number of Workers in Cluster' )
2100
2100
parser .add_argument ('-cdh' , '--cdh_version' , metavar = 'cdh_version' , help = 'CDH version to deploy' )
2101
2101
parser .add_argument ('-ad' , '--availability_domain' , metavar = 'availability_domain' , help = 'OCI Availability Domain' )
2102
+ parser .add_argument ('-N' , '--cluster_name' , metavar = 'cluster_name' , help = 'CDH Cluster Name' )
2102
2103
options = parser .parse_args (args )
2103
2104
if not options .cm_server :
2104
2105
print ('Cloudera Manager Server IP required.' )
@@ -2117,6 +2118,10 @@ def options_parser(args=None):
2117
2118
print ('OCI Availability Domain is required.' )
2118
2119
parser .print_help ()
2119
2120
exit (- 1 )
2121
+ if options .cm_server and not options .cluster_name :
2122
+ print ('Cluster Name is required.' )
2123
+ parser .print_help ()
2124
+ exit (- 1 )
2120
2125
2121
2126
if options .license_file :
2122
2127
try :
@@ -2129,7 +2134,7 @@ def options_parser(args=None):
2129
2134
sys .exit ()
2130
2135
2131
2136
return (options .cm_server , options .input_host_list , options .disk_count , options .license_file , options .worker_shape ,
2132
- options .num_workers , options .simple_deployment , options .cdh_version , options .availability_domain )
2137
+ options .num_workers , options .deployment_type , options .cdh_version , options .availability_domain , options . cluster_name )
2133
2138
2134
2139
#
2135
2140
# MAIN FUNCTION FOR CLUSTER DEPLOYMENT
@@ -2315,14 +2320,21 @@ def enable_kerberos():
2315
2320
#
2316
2321
2317
2322
if __name__ == '__main__' :
2318
- cm_server , input_host_list , disk_count , license_file , worker_shape , num_workers , simple_deployment , cdh_version , cms_version = \
2323
+ cm_server , input_host_list , disk_count , license_file , worker_shape , num_workers , deployment_type , cdh_version , cms_version , cluster_name = \
2319
2324
options_parser (sys .argv [1 :])
2320
2325
if debug == 'True' :
2321
2326
print ('cm_server = %s' % cm_server )
2322
2327
print ('input_host_list = %s' % input_host_list )
2323
2328
print ('disk_count = %s' % disk_count )
2324
2329
print ('license_file = %s' % license_file )
2325
2330
print ('worker_shape = %s' % worker_shape )
2331
+ print ('cluster_name = %s' % cluster_name )
2332
+ print ('deployment_type = %s' % deployment_type )
2333
+ if deployment_type == 'simple' :
2334
+ hdfs_ha = 'False'
2335
+ secure_cluster = 'False'
2336
+ else :
2337
+ pass
2326
2338
user_name = 'admin'
2327
2339
password = 'admin'
2328
2340
print ('->Building API Endpoints' )
@@ -2348,14 +2360,14 @@ def enable_kerberos():
2348
2360
time .sleep (30 )
2349
2361
wait_status = wait_status + '*'
2350
2362
2351
- if simple_deployment == 'True ' :
2363
+ if deployment_type == 'simple ' :
2352
2364
print ('Simple Deployment Selected' )
2353
2365
print ('Cluster Security and High Availabilty are DISABLED' )
2354
2366
else :
2355
2367
print ('Cluster Deployment options - HA: %s - Kerberos: %s' % (hdfs_ha , secure_cluster ))
2356
2368
2357
2369
build_cloudera_cluster ()
2358
- if simple_deployment == 'True ' :
2370
+ if deployment_type == 'simple ' :
2359
2371
exit (0 )
2360
2372
else :
2361
2373
if hdfs_ha == 'True' :
0 commit comments