forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
new-vpc-single-rabbitmq.yml
406 lines (405 loc) · 13.6 KB
/
new-vpc-single-rabbitmq.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Deploy the RabbitMQ (3.8.4) service on the ECS host, which is an open source
AMQP-implemented message middleware service that supports a variety of client
connections with robust, stable, easy-to-use, cross-platform, multilingual features.
zh-cn: 在ECS主机上部署RabbitMQ(3.8.4)服务,RabbitMQ是一个开源AMQP实现的消息中间件服务,支持多种客户端连接,具备健壮、稳定、易用、跨平台、支持多种语言的特性。
Parameters:
VSwitchZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交换机可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources,which is recommended to be different from other VSwitch Availability
Zone</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: New proprietary network IP address segment range, recommended use of the
following IP address segments<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
zh-cn: 新建专有网络IP地址段范围,推荐使用以下的IP地址段<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Network segments of new switches, subnets of virtual proprietary networks
zh-cn: 新建交换机的网段,所属虚拟专有网络的子网
Default: 192.168.0.0/24
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the
current available zone under the model is in stock, some models need to be
reported in advance</b></font><br><font color='blue'><b>2.List of optional
models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet
bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge
<font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and
receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1.选择机型前请先确认当前可用区下该机型是否有货,部分机型需要提前报备</b></font><br><font
color='blue'><b>2.可选机型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU
4GiB 内网带宽1Gbps 内网收发包30万PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU
8GiB 内网带宽1.5Gbps 内网收发包50万PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB 内网带宽2.5Gbps 内网收发包80万PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
SystemDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency:
<font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD
Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud:
<font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local
SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font
color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]<br>[cloud_essd:
<font color=''green''>ESSD云盘</font>]<br>[cloud: <font color=''green''>普通云盘</font>]<br>[ephemeral_ssd:
<font color=''green''>本地SSD盘</font>]'
Default: cloud_efficiency
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud
- cloud_essd
- ephemeral_ssd
SystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk size, range of values: 20-500, units: GB.'
zh-cn: 系统盘大小, 取值范围:[20, 500], 单位:GB。
Default: 20
Password:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
MaxQueueNumber:
Type: Number
Label:
en: Number of Queues
zh-cn: Queue数量
Description:
en: 'Single Vhost Creates Queue Quantity, Value Range: 1~2000'
zh-cn: 单Vhost创建的Queue数量,取值范围:[1, 2000]
Default: 100
MinValue: 1
MaxValue: 2000
HighWatermark:
Type: String
Label:
en: Flow Control Limits
zh-cn: 流控限制
Description:
en: 'RabbitMQ service uses a certain threshold of system memory, it activates
a memory alarm and triggers a flow control mechanism, with optional configurations:
0.4 (40%), 0.6 (60%), 0.8 (80%)'
zh-cn: RabbitMQ服务占用系统内存达到一定阈值时,会启动内存报警,触发流控机制,可选配置:0.4(40%),0.6(60%),0.8(80%)
Default: '0.4'
AllowedValues:
- '0.4'
- '0.6'
- '0.8'
RabbitMQAdminName:
Type: String
Label:
en: Administrator Username
zh-cn: 管理员用户名
Description:
en: RabbitMQ Administrator Username
zh-cn: RabbitMQ管理员用户名
Default: admin
RabbitMQAdminPassword:
Type: String
Label:
en: Administrator User Login Password
zh-cn: 管理员用户登录密码
Description:
en: RabbitMQ administrator user login password, length 8-30
zh-cn: RabbitMQ管理员用户登录密码,长度8-30
ConstraintDescription:
en: Length 8-30
zh-cn: 长度8-30
NoEcho: true
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName: MyVPC
Metadata:
ALIYUN::ROS::Designer:
id: cd62e181-1aec-4b74-a9a2-69d7949056fb
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupEgress:
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: intranet
PortRange: -1/-1
Priority: 1
SecurityGroupIngress:
- IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName: SG
Metadata:
ALIYUN::ROS::Designer:
id: 2db1741c-3ff9-42d0-a150-6f77a61b6a11
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Fn::Select:
- '0'
- Fn::GetAZs:
Ref: ALIYUN::Region
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
Metadata:
ALIYUN::ROS::Designer:
id: a2924908-10e1-4c79-baf7-16636fbdee84
RabbitMQServer:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Fn::GetAtt:
- EcsVpc
- VpcId
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId: centos_7
AllocatePublicIP: true
InstanceName: RabbitMQServer
InstanceType:
Ref: InstanceType
MaxAmount: 1
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - '#!/bin/sh'
- " \n"
- "yum update -y \n"
- "wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/RabbitMQ/erlang-23.0.2-1.el7.x86_64.rpm\
\ \n"
- "rpm -Uvh erlang-23.0.2-1.el7.x86_64.rpm \n"
- "yum -y install socat \n"
- "wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/RabbitMQ/rabbitmq-server-3.8.4-1.el7.noarch.rpm\
\ \n"
- "rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc\
\ \n"
- "rpm -Uvh rabbitmq-server-3.8.4-1.el7.noarch.rpm \n"
- "rabbitmq-plugins enable rabbitmq_management \n"
- 'echo vm_memory_high_watermark.relative = '
- Ref: HighWatermark
- ">> /etc/rabbitmq/rabbitmq.conf \n"
- "service rabbitmq-server restart \n"
- "chkconfig rabbitmq-server on \n"
- 'rabbitmqctl add_user '
- Ref: RabbitMQAdminName
- ' '
- Ref: RabbitMQAdminPassword
- '
'
- 'rabbitmqctl set_user_tags '
- Ref: RabbitMQAdminName
- " administrator \n"
- 'rabbitmqctl set_permissions -p / '
- Ref: RabbitMQAdminName
- " \".*\" \".*\" \".*\" \n"
- 'rabbitmqctl set_vhost_limits -p / ''{"max-queues":'
- Ref: MaxQueueNumber
- "}' \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\
\"SUCCESS\\\"}\" \n"
DependsOn: EcsVSwitch
Metadata:
ALIYUN::ROS::Designer:
id: 22852ebe-413c-4474-a95c-396d4a45a662
RosWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 163244f3-f503-402f-ab5b-ef19fbcdc7d7
RosWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: RosWaitConditionHandle
Timeout: 1800
Metadata:
ALIYUN::ROS::Designer:
id: 3b557656-6947-49eb-b4a3-c809db365a1c
Outputs:
RabbitMQWebUrl:
Value:
Fn::Join:
- ''
- - http://
- Fn::Select:
- '0'
- Fn::GetAtt:
- RabbitMQServer
- PublicIps
- :15672
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- VpcCidrBlock
- VSwitchCidrBlock
Label:
default:
en: Infrastructure Configuration
zh-cn: 基础资源配置(必填)
- Parameters:
- InstanceType
- SystemDiskCategory
- SystemDiskSize
- Password
- MaxQueueNumber
- HighWatermark
- RabbitMQAdminName
- RabbitMQAdminPassword
Label:
default:
en: RabbitMQ Configuration
zh-cn: RabbitMQ 配置(必填)
TemplateTags:
- acs:example:弹性计算:RabbitMQ单机版(新建VPC)
ALIYUN::ROS::Designer:
163244f3-f503-402f-ab5b-ef19fbcdc7d7:
position:
x: 1013
y: 316
size:
height: 60
width: 60
z: 0
22852ebe-413c-4474-a95c-396d4a45a662:
position:
x: 731
y: 481
size:
height: 60
width: 60
z: 2
2db1741c-3ff9-42d0-a150-6f77a61b6a11:
position:
x: 731
y: 320
size:
height: 60
width: 60
z: 1
3b557656-6947-49eb-b4a3-c809db365a1c:
position:
x: 1013
y: 486
size:
height: 60
width: 60
z: 0
6aa3f5af-2303-4eaa-9284-4f8818cbb972:
source:
id: 3b557656-6947-49eb-b4a3-c809db365a1c
target:
id: 163244f3-f503-402f-ab5b-ef19fbcdc7d7
z: 1
a2924908-10e1-4c79-baf7-16636fbdee84:
embeds:
- 22852ebe-413c-4474-a95c-396d4a45a662
position:
x: 668
y: 435
size:
height: 204
width: 196
z: 1
c0fe3d47-2853-4cfb-9c4b-90132fde15d7:
source:
id: 22852ebe-413c-4474-a95c-396d4a45a662
target:
id: 2db1741c-3ff9-42d0-a150-6f77a61b6a11
z: 1
cd62e181-1aec-4b74-a9a2-69d7949056fb:
embeds:
- a2924908-10e1-4c79-baf7-16636fbdee84
- 2db1741c-3ff9-42d0-a150-6f77a61b6a11
position:
x: 583
y: 282
size:
height: 413
width: 383.0146484375
z: 0