更新时间:2024-11-29 GMT+08:00
创建MRS集群
场景描述
本章节指导用户通过API创建一个MRS分析集群。API的调用方法请参见如何调用API。
约束限制
操作步骤
- 接口相关信息
URI格式:POST /v2/{project_id}/clusters
详情请参见创建集群。
- 请求示例
POST: https://{endpoint}/v2/{project_id}/clusters
- {endpoint}信息具体请参考终端节点。
- {project_id}信息请通过获取项目ID获取。
- 节点的实例规格参数“node_size”建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。
Body:{ "cluster_version": "MRS 3.3.1-LTS", "cluster_name": "mrs_Demo", "cluster_type": "ANALYSIS", "charge_info": { "charge_mode": "postPaid" }, "region": "", "availability_zone": "", "vpc_name": "vpc-37cd", "subnet_name": "subnet-ed99", "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,FTP-Server,Solr,Flink,Oozie,GraphBase,HetuEngine,Ranger,Tez", "safe_mode": "KERBEROS", "manager_admin_password": "xxx", "login_mode": "PASSWORD", "node_root_password": "xxx", "log_collection": 1, "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY", "tags": [ { "key": "tag1", "value": "111" }, { "key": "tag2", "value": "222" } ], "node_groups": [ { "group_name": "master_node_default_group", "node_num": 2, "node_size": "rc3.4xlarge.4.linux.bigdata", "root_volume": { "type": "SAS", "size": 480 }, "data_volume": { "type": "SAS", "size": 600 }, "data_volume_count": 1 }, { "group_name": "core_node_analysis_group", "node_num": 3, "node_size": "rc3.4xlarge.4.linux.bigdata", "root_volume": { "type": "SAS", "size": 480 }, "data_volume": { "type": "SAS", "size": 600 }, "data_volume_count": 1 }, { "group_name": "task_node_analysis_group", "node_num": 3, "node_size": "rc3.4xlarge.4.linux.bigdata", "root_volume": { "type": "SAS", "size": 480 }, "data_volume": { "type": "SAS", "size": 600 }, "data_volume_count": 1, "auto_scaling_policy": { "auto_scaling_enable": true, "min_capacity": 0, "max_capacity": 1, "resources_plans": [], "exec_scripts": [], "rules": [ { "name": "default-expand-1", "description": "", "adjustment_type": "scale_out", "cool_down_minutes": 5, "scaling_adjustment": "1", "trigger": { "metric_id": 2003, "metric_name": "StormSlotAvailablePercentage", "metric_value": 100, "comparison_operator_id": 2003, "comparison_operator": "LTOE", "evaluation_periods": "1" } } ] } } ] }
参数详细信息请参考创建集群获取。
- 响应示例
{ "cluster_id": "da1592c2-bb7e-468d-9ac9-83246e95447a" }
父主题: 应用示例