模板ID
FOOKUK1EPTFB97PA
地址:https://bpstudio.console.aliyun.com/bpStudio/topo?TemplateId=FOOKUK1EPTFB97PA
模板架构
业务场景说明:
业务上希望在A地域的NLB实例能够挂载另外两个不同地域的ECS实例,实现跨地域高可用。按需设计架构:
在阿里云西南1(成都)地域创建了专有网络VPC1,在VPC1中创建了一个NLB实例,并在VPC1内创建了云服务器ECS1作为客户端测试验证跨地域负载均衡访问;
同时在华东2(上海)创建了专有网络VPC2,并在VPC2中创建了云服务器ECS2实例;
在华北1(青岛)创建了专有网络VPC3并在VPC3中创建了云服务器ECS3实例,ECS2与ECS3中部署了相同的服务。
三个地域的互联,基于阿里云的云企业网和转发路由器实现,并配置跨地域连接和带宽。
参数变量
参数变量类型包括String、Integer、Boolean、Map等,通过variables传递相关参数值。
如果未传递,则使用默认值。 如果修改模板变量配置,可以参考:模板变量配置
序号 | 变量名称 | 变量类型 | 默认值 | 描述 |
1 | ${cen-name} | String | 企业版cen-test | 云企业网名称 |
2 | ${nlb-name} | String | nlb-test | NLB实例名称 |
3 | ${instance-tags} | Map | {"createBy":"cadt"} | 资源标签 |
4 | ${nlb-listener} | String | nlb_listener_80 | NLB的监听 |
5 | ${nlb-listener-port} | Integer | 80 | 监听端口 |
6 | ${nlb-vservergroup-01} | String | nlb_servergroup | 虚拟服务器组 |
7 | ${nlb-sg-backend-port} | List<Map> | [{"backend_port":"80","weight":100}] | 服务器组端口配置 |
8 | ${ecs-01-num} | Integer | 1 | ECS01的实例数量 |
9 | ${ecs-01-type} | String | ecs.c6.large | ECS01的实例规格 |
10 | ${ecs-01-name} | String | ecs-chengdu-01 | ECS01的实例/主机名称 |
11 | ${ecs-01-password} | String | Test1234 | ECS01的密码 |
12 | ${ecs-01-privateip} | String | 10.0.1.100 | ECS01的私网IP地址 |
13 | ${ecs-02-num} | Integer | 1 | ECS02的实例数量 |
14 | ${ecs-02-type} | String | ecs.c6.large | ECS02的实例规格 |
15 | ${ecs-02-name} | String | ecs-shanghai-01 | ECS02的实例/主机名称 |
16 | ${ecs-02-password} | String | Test1234 | ECS02的密码 |
17 | ${ecs-02-privateip} | String | 10.10.1.100 | ECS02的私网IP地址 |
18 | ${ecs-03-num} | Integer | 1 | ECS03的实例数量 |
19 | ${ecs-03-type} | String | ecs.c6.large | ECS03的实例规格 |
20 | ${ecs-03-name} | String | ecs-qingdao-01 | ECS03的实例/主机名称 |
21 | ${ecs-03-password} | String | Test1234 | ECS03的密码 |
22 | ${ecs-03-privateip} | String | 10.20.1.100 | ECS03的私网IP地址 |
命令行调试
YAML文件传参配置示例(默认VPC、交换机、共享带宽、NLB、ECS均为新创建):
template_id: FOOKUK1EPTFB97PA
#area_id: "cn-beijing"
instances:
# - node_type: vpc
# node_name: vpc-01
# id: vpc-bp**********ws
# - node_type: vswitch
# node_name: chengdu-vsw01
# id: vsw-bp**********0ex
# - node_type: vswitch
# node_name: chengdu-vsw02
# id: vsw-bp**********1ek
# - node_type: vpc
# node_name: vpc-02
# id: vpc-bp**********ws
# - node_type: vswitch
# node_name: shanghai-vsw01
# id: vsw-bp**********0ex
# - node_type: vswitch
# node_name: shanghai-vsw02
# id: vsw-bp**********1ek
# - node_type: vpc
# node_name: vpc-03
# id: vpc-bp**********ws
# - node_type: vswitch
# node_name: qingdao-vsw01
# id: vsw-bp**********0ex
# - node_type: vswitch
# node_name: qingdao-vsw02
# id: vsw-bp**********1ek
# 默认新建VPC和交换机,已注释对应参数。复用现有VPC和交换机时,取消注释,替换对应的实例ID
variables:
${nlb-name}: "ali-prod-nlb"
${nlb-network-type}: "Intranet"
# 私网:Intranet,公网:Internet
${nlb-listener}: "listener_TCP_80"
${nlb-listener-port}: "80"
${nlb-vservergroup-01}: "SG_TCP_01"
${nlb-sg-backend-port}: "[{\"backend_port\":\"80\",\"weight\":\"100\"}]"
${cen-name}: "企业版CEN-01"
${ecs-01-num}: "1"
${ecs-01-type}: "ecs.c6.large"
${ecs-01-name}: "ecs-chengdu-01"
${ecs-01-privateip}: "10.0.1.100"
${ecs-01-password}: "Test1234"
${ecs-02-num}: "1"
${ecs-02-type}: "ecs.c6.large"
${ecs-02-name}: "ecs-shanghai-01"
${ecs-02-privateip}: "10.10.1.100"
${ecs-02-password}: "Test1234"
${ecs-03-num}: "1"
${ecs-03-type}: "ecs.c6.large"
${ecs-03-name}: "ecs-qingdao-01"
${ecs-03-privateip}: "10.20.1.100"
${ecs-03-password}: "Test1234"
${instance-tags}: "{\"env\":\"test\",\"createBy\":\"cadt\"}"
#${resourcegroupId}: "rg-ac*****y"
configuration:
enableMonitor: "0"
enableReport: "0"
output:
nlb:
- Address
- Port
ecs:
- Private_ip
备注说明:
1、如果需要替换模板中的已保有实例,比如使用存量的VPC、交换机等。可以替换对应的instances的ID字段。
instances:
- node_type: vpc
node_name: vpc-01
id: vpc-bp**********ws
- node_type: vswitch
node_name: chengdu-vsw01
id: vsw-bp**********0ex
- node_type: vswitch
node_name: chengdu-vsw02
id: vsw-bp**********1ek
- node_type: vpc
node_name: vpc-02
id: vpc-bp**********ws
- node_type: vswitch
node_name: shanghai-vsw01
id: vsw-bp**********0ex
- node_type: vswitch
node_name: shanghai-vsw02
id: vsw-bp**********1ek
- node_type: vpc
node_name: vpc-03
id: vpc-bp**********ws
- node_type: vswitch
node_name: qingdao-vsw01
id: vsw-bp**********0ex
- node_type: vswitch
node_name: qingdao-vsw02
id: vsw-bp**********1ek