@@ -1110,32 +1110,39 @@ def execute(self, opts):
11101110 services , errors = process_services (opts .services , self .enterprise , self .enterprise_analytics )
11111111 _exit_if_errors (errors )
11121112
1113- if not self .enterprise_analytics and 'kv' not in services .split (',' ):
1114- _exit_if_errors (["Cannot set up first cluster node without the data service" ])
1115-
11161113 if 'ipv4' in opts .ip_family :
11171114 ip_family = 'ipv4'
11181115 elif 'ipv6' in opts .ip_family :
11191116 ip_family = 'ipv6'
11201117 ip_only = True if 'only' in opts .ip_family else False
11211118
1122- if not self .enterprise_analytics and not opts .index_storage_mode and 'index' in services .split (',' ):
1123- opts .index_storage_mode = "default"
1119+ indexer_storage = None
1120+ if not self .enterprise_analytics :
1121+ if 'kv' not in services .split (',' ):
1122+ _exit_if_errors (["Cannot set up first cluster node without the data service" ])
11241123
1125- default = "plasma"
1126- if not self .enterprise :
1127- default = "forestdb"
1124+ if not opts .index_storage_mode and 'index' in services .split (',' ):
1125+ opts .index_storage_mode = "default"
11281126
1129- indexer_storage = None
1130- if opts . index_storage_mode :
1131- indexer_storage = index_storage_mode_to_param ( opts . index_storage_mode , default )
1127+ default = "plasma"
1128+ if not self . enterprise :
1129+ default = "forestdb"
11321130
1133- min_version , errors = self . rest . node_version ()
1134- _exit_if_errors ( errors )
1131+ if opts . index_storage_mode :
1132+ indexer_storage = index_storage_mode_to_param ( opts . index_storage_mode , default )
11351133
1136- versionCheck = compare_versions (min_version , "7.2.3" )
1137- if not self .enterprise_analytics and versionCheck == - 1 :
1138- _exit_if_errors (["--cluster-init can only be used against >= 7.2.3 clusters" ])
1134+ min_version , errors = self .rest .node_version ()
1135+ _exit_if_errors (errors )
1136+
1137+ versionCheck = compare_versions (min_version , "7.2.3" )
1138+ if versionCheck == - 1 :
1139+ _exit_if_errors (["--cluster-init can only be used against >= 7.2.3 clusters" ])
1140+ else :
1141+ settings , err = self .rest .get_analytics_settings ()
1142+ _exit_if_errors (err )
1143+ if not settings .get ('blobStorageScheme' ):
1144+ _exit_if_errors (
1145+ ["Cannot initialize cluster before running the 'setting-enterprise-analytics' command" ])
11391146
11401147 if not self .enterprise and opts .notifications == "0" :
11411148 _exit_if_errors (["--update-notifications can only be configured on Enterprise Edition" ])
@@ -3497,21 +3504,27 @@ def __init__(self):
34973504 help = "The BLOB storage endpoint" )
34983505 group .add_argument ("--anonymous-auth" , dest = "blob_storage_anonymous_auth" , metavar = "<0|1>" ,
34993506 choices = ["0" , "1" ], help = "Allow BLOB storage anonymous auth" )
3507+ group .add_argument ("--path-style-addressing" , dest = "blob_storage_path_style_addressing" , metavar = "<0|1>" ,
3508+ choices = ["0" , "1" ], help = "Use BLOB storage path style addressing" )
35003509
3501- # We disable the cluster init check so people can use '--set' before the cluster is initiaslised . See MB-66986.
3510+ # We disable the cluster init check so people can use '--set' before the cluster is initialised . See MB-66986.
35023511 @rest_initialiser (cluster_init_check = False , version_check = True )
35033512 def execute (self , opts ):
35043513 if opts .set :
35053514 if not (opts .num_storage_partitions or opts .blob_storage_scheme or opts .blob_storage_bucket
35063515 or opts .blob_storage_prefix or opts .blob_storage_region or opts .blob_storage_endpoint
3507- or opts .blob_storage_anonymous_auth ):
3516+ or opts .blob_storage_anonymous_auth or opts . blob_storage_path_style_addressing ):
35083517 _exit_if_errors (["At least one option (--partitions, --scheme, --bucket, --prefix, --region," +
3509- " --endpoint, --anonymous-auth) must be specified." ])
3518+ " --endpoint, --anonymous-auth, --path-style-addressing ) must be specified." ])
35103519
35113520 if opts .blob_storage_anonymous_auth == "0" :
35123521 opts .blob_storage_anonymous_auth = "false"
35133522 if opts .blob_storage_anonymous_auth == "1" :
35143523 opts .blob_storage_anonymous_auth = "true"
3524+ if opts .blob_storage_path_style_addressing == "0" :
3525+ opts .blob_storage_path_style_addressing = "false"
3526+ if opts .blob_storage_path_style_addressing == "1" :
3527+ opts .blob_storage_path_style_addressing = "true"
35153528
35163529 _ , errors = self .rest .set_enterprise_analytics_settings (opts )
35173530 _exit_if_errors (errors )
0 commit comments