forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrate-rocketmq-to-cloud.yml
163 lines (162 loc) · 4.91 KB
/
migrate-rocketmq-to-cloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Migrate RocketMQ to Cloud.
zh-cn: 自建RocketMQ集群迁移至云消息队列RocketMQ版。
Parameters:
CommonName:
Type: String
Default: migrate-rocketmq
ZoneId:
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::ZoneId'
AssociationPropertyMetadata:
AutoSelectFirst: true
Label:
en: Availability Zone
zh-cn: 可用区
InstanceType:
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
AssociationPropertyMetadata:
InstanceChargeType: PostPaid
SystemDiskCategory: cloud_essd
ZoneId: ${ZoneId}
Label:
en: Instance Type
zh-cn: 实例规格
Default: ecs.c7.large
InstancePassword:
NoEcho: true
Type: String
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符号)
Label:
en: Instance Password
zh-cn: 实例密码
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号)'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
Default: null
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Sub: ${CommonName}-vpc
VSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: ${CommonName}-vsw
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
SecurityGroupIngress:
- PortRange: 22/22
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 443/443
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 80/80
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 8080/8080
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 9876/9876
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
EcsInstance:
Type: 'ALIYUN::ECS::InstanceGroup'
Properties:
VpcId:
Ref: Vpc
ZoneId:
Ref: ZoneId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId: aliyun_3_9_x64_20G_alibase_
InstanceName:
Fn::Sub: ${CommonName}-ecs
InstanceType:
Ref: InstanceType
SystemDiskCategory: cloud_essd
MaxAmount: 1
InternetMaxBandwidthOut: 100
Password:
Ref: InstancePassword
DownloadRocketMQ:
Type: 'ALIYUN::ECS::RunCommand'
Properties:
InstanceIds:
Fn::GetAtt:
- EcsInstance
- InstanceIds
Type: RunShellScript
Sync: true
Timeout: 3600
CommandContent:
Fn::Sub: |-
#!/bin/bash
export PATH=/usr/local/bin:$PATH
wget -O credit_demo.jar https://labfileapp.oss-cn-hangzhou.aliyuncs.com/database/credit_demo.jar
wget -O init_demo.jar https://labfileapp.oss-cn-hangzhou.aliyuncs.com/database/init_demo.jar
wget -O csv2lindorm.jar https://labfileapp.oss-cn-hangzhou.aliyuncs.com/database/csv2lindorm.jar
wget -O lindorm-sqlline-0.1.4.tar.gz https://labfileapp.oss-cn-hangzhou.aliyuncs.com/database/lindorm-sqlline-0.1.4.tar.gz
wget -O ldspark-3.2.1-current.tgz https://labfileapp.oss-cn-hangzhou.aliyuncs.com/database/ldspark-3.2.1-current.tgz
RocketMQ:
Type: 'ALIYUN::ROCKETMQ5::Instance'
Properties:
ProductInfo:
MsgProcessSpec: 'rmq.s1.micro'
InternetInfo:
InternetSpec: disable
SubSeriesCode: single_node
InstanceName:
Fn::Sub: ${CommonName}-mq
SeriesCode: standard
PaymentType: PayAsYouGo
VpcInfo:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
Outputs:
EcsLoginAddress:
Description:
zh-cn: ECS登录地址。
en: Ecs login address.
Value:
'Fn::Sub': https://ecs-workbench.aliyun.com/?from=EcsConsole&instanceType=ecs®ionId=${ALIYUN::Region}&instanceId=${EcsInstance}
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- InstanceType
- InstancePassword
TemplateTags:
- acs:technical-solution:cloud-migration:自建RocketMQ集群迁移至云消息队列RocketMQ版-tech_solu_121
Hidden:
- CommonName