forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
self-built-elastic-search-snapshot-saved-to-oss.yml
601 lines (601 loc) · 19.1 KB
/
self-built-elastic-search-snapshot-saved-to-oss.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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: This template is used to back up data from snapshots of a self-managed Elasticsearch
cluster to OSS and restore the data from the snapshots in the repositories stored
in OSS buckets to an Alibaba Cloud Elasticsearch cluster.
zh-cn: 本文介绍如何通过快照的方式,将快照数据安全备份到阿里云OSS存储空间及如何将备份在OSS的快照仓库恢复到阿里云ElasticSearch实例。
Parameters:
VSwitchZoneId:
Type: String
Label:
en: 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.</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: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges: <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地址段范围,<br>您可以使用以下的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:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
VswCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.100.0/24
ImageIdVPN:
Type: String
Label:
en: FlexGW VPN Image
zh-cn: FlexGW VPN镜像
Description:
en: 'Server Instance Image ID<br>cloud market mirror name: FlexGW IPsec VPN
on CentOS<br>Hangzhou: m-bp10z4rsouipm8yfurxh<br>Qingdao: m-m5eg9k9vsopnrj7ejwo9<br>Beijing:
m-2ze7k40e4ke66ouil52d<br>Shanghai: m-uf67h1a8x3ykhrtrtjrh<br>Shenzhen: m-wz97moazgfw3xy6xjb2x<br>note:
If the above image does not provide a mirror of the geographical region, please
use the supported FlexGW VPN free image; see detail: <b><a href=''https://marketplace.alibabacloud.com/products?keywords=FlexGW''
target=''_blank''><font color=''blue''>FlexGW Image</font></a></b>'
zh-cn: 服务器镜像<br>云市场镜像名称:FlexGW IPsec VPN服务器企业版<br>杭州:m-bp10z4rsouipm8yfurxh<br>青岛:m-m5eg9k9vsopnrj7ejwo9<br>北京:m-2ze7k40e4ke66ouil52d<br>上海:m-uf67h1a8x3ykhrtrtjrh<br>深圳:m-wz97moazgfw3xy6xjb2x<br>注:以上镜像如未提供该地域的镜像,请使用支持的FlexGW
VPN系统镜像;详见:<b><a href='https://market.aliyun.com/products/56812015/cmjj006981.html'
target='_blank'><font color='blue'>FlexGW VPN系统镜像</font></a></b>
ImageIdELK:
Type: String
Label:
en: ELK Image
zh-cn: ELK镜像
Description:
en: Image ID, represents the image resource to startup one ECS instance, <font><a
href='https://www.alibabacloud.com/help/doc-detail/112977.html' target='_blank'><b><font
color='blue'>View image resources</b></font></a>
zh-cn: 镜像ID,ECS实例的镜像资源, <font><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><b><font color='blue'>查看镜像资源</b></font></a>
Default: centos_7.4
ImageIdApp:
Type: String
Label:
en: Application Service Image
zh-cn: 应用服务镜像
Description:
en: 'Server Instance Image ID. <br>Hangzhou Magento Mirror: m-bp1d9e2n6iw68exr0z9h<br>Shenzhen
Magento Mirror: m-wz9g8nzni5lkutmmj5jrjr<br>Beijing Magento Mirror: m-2zefvtmu
9vljd06ll1u<br>Qingdao Magento Mirror: m-m5e92ot9nf1rm9c8neob<br>Shanghai
Magento Image: m-uf67vlqunx 6ldjsaaxo2<br>note: If the above image does not
provide a mirror of the geographical region, please use the supported magento
free image; see detail: <b><a href=''https://marketplace.alibabacloud.com/products?keywords=magento''
target=''_blank''><font color=''blue''>Magento Image</font></a></b>'
zh-cn: 服务器镜像<br>云市场镜像名称: Magento电子商务系统(Centos 7.2 64位)<br>版本:v1.0<br>杭州Magento镜像:m-bp1d9e2n6iw68exr0z9h<br>深圳Magento镜像:m-wz9g8nzni5lkutmmj5jr<br>北京Magento镜像:m-2zefvttmu9vljd06ll1u<br>青岛Magento镜像:m-m5e92ot9nf1rm9c8neob<br>上海Magento镜像:m-uf67vlqunx6ldjsaaxo2<br>注:以上镜像如未提供该地域的镜像,请使用支持的magento免费镜像;详见:<b><a
href='https://market.aliyun.com/products/?keywords=Magento' target='_blank'><font
color='blue'>Magento镜像</font></a></b>
EcsInstanceType:
Type: String
Label:
en: Specifications
zh-cn: 规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone;recommended to use:ecs.t5-lc1m2.large</b></font><br>general specifications:<font
color=''red''><b>ecs.g5.large</b></font><br>note: a few zones do not support
general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格,推荐使用:ecs.t5-lc1m2.large;<br>通用规格:<font color='red'><b>ecs.g5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
EcsPassword:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: 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
BucketName:
Type: String
Label:
en: Bucket Name
zh-cn: 存储空间名称
Description:
en: The name must be 3 to 63 bytes in length, The name must start and end with
a lowercase letter or digit.The name can contain only lowercase letters, digits,
and hyphens (-).;<br><b>note:<font color='blue'>A bucket name must be globally
unique within OSS. Bucket names cannot be changed after the bucket is created.</b></font>
zh-cn: 长度为3~63个字符,必须以小写字母或数字开头和结尾,可以包含小写字母、数字和连字符(-);<br><font color='blue'><b>注:需要全网唯一性,已经存在的不能在创建</b></font>
Default: elasticsearch-repository-test
DeletionForce:
Type: Boolean
Label:
en: Support for Force Deletion
zh-cn: 支持强制删除
Description:
en: Do you want to force the deletion of files in OSS?
zh-cn: 是否强制删除OSS中的文件
Default: false
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
Description: 客户IDC-VPC
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 114d8caf-9041-4c22-a8c5-21f82d937187
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: tcp
Policy: accept
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
Policy: accept
PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
Policy: accept
PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
Policy: accept
PortRange: 3306/3306
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
Policy: accept
PortRange: 9200/9200
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
Policy: accept
PortRange: 5601/5601
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName: ElasticSearchSG
Tags:
- Key: best_practice
Value: 095
Metadata:
ALIYUN::ROS::Designer:
id: bfa8a058-ad24-4d06-9c4c-020bb180f1bb
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VswCidrBlock
VSwitchName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 03e32041-eed6-413c-8ab4-a57272248ce9
EcsInstanceELK:
Type: ALIYUN::ECS::Instance
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVSwitch
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageIdELK
AllocatePublicIP: true
HostName: elasticsearch
InstanceName: elasticsearch
InstanceType:
Ref: EcsInstanceType
InternetChargeType: PayByTraffic
Password:
Ref: EcsPassword
Tags:
- Key: 095
Value: best_practice
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandleELK
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- "wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/elk/install_elasticsearch_and_start.sh\
\ \n"
- "chmod 755 install_elasticsearch_and_start.sh \n"
- "./install_elasticsearch_and_start.sh \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\
\"SUCCESS\\\"}\" \n"
Metadata:
ALIYUN::ROS::Designer:
id: cc6061af-e57f-4b06-848f-335f82956a03
EcsInstanceApp:
Type: ALIYUN::ECS::Instance
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVSwitch
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageIdApp
AllocatePublicIP: true
HostName: flexgw-magento
InstanceName: flexgw-magento
InstanceType:
Ref: EcsInstanceType
InternetChargeType: PayByTraffic
Password:
Ref: EcsPassword
Tags:
- Key: 095
Value: best_practice
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandleApp
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- elk_PrivateIp=
- Fn::GetAtt:
- EcsInstanceELK
- PrivateIp
- " \n"
- "echo \"$elk_PrivateIp elasticsearch\" >> /etc/hosts \n"
- "wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/elk/install_logstash_and_start.sh\
\ \n"
- "chmod 755 install_logstash_and_start.sh \n"
- "./install_logstash_and_start.sh \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\
\"SUCCESS\\\"}\" \n"
DependsOn: EcsInstanceELK
Metadata:
ALIYUN::ROS::Designer:
id: a3eb4ff3-9663-44f1-b771-d562d853703b
EcsInstanceVPN:
Type: ALIYUN::ECS::Instance
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVSwitch
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageIdVPN
AllocatePublicIP: true
HostName: flexgw-vpn
InstanceName: flexgw-vpn
InstanceType:
Ref: EcsInstanceType
InternetChargeType: PayByTraffic
Password:
Ref: EcsPassword
Tags:
- Key: 095
Value: best_practice
Metadata:
ALIYUN::ROS::Designer:
id: 44000149-e23e-41a0-a1d6-a33af76c0aef
OssBucket:
Type: ALIYUN::OSS::Bucket
Properties:
BucketName:
Ref: BucketName
DeletionForce:
Ref: DeletionForce
Tags:
Key: best_practice
Value: 095
Metadata:
ALIYUN::ROS::Designer:
id: 644e1541-b00b-4635-84dd-819db763baa3
RosWaitConditionHandleApp:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 69101592-3363-4ead-9682-b7d1e843afcd
RosWaitConditionApp:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: RosWaitConditionHandleApp
Timeout: 600
DependsOn: RosWaitConditionHandleApp
Metadata:
ALIYUN::ROS::Designer:
id: 6b314593-fe35-43ae-afb5-672722fc3695
RosWaitConditionHandleELK:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 8130d753-6dd8-4b5e-9928-92eeaadeb7d9
RosWaitConditionELK:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: RosWaitConditionHandleELK
Timeout: 600
DependsOn: RosWaitConditionHandleELK
Metadata:
ALIYUN::ROS::Designer:
id: 90b9f494-cb93-4afc-a372-83fade27cb20
Outputs:
BucketDomainName:
Description:
en: The domain name of the storage space
zh-cn: 存储空间的域名
Value:
Fn::GetAtt:
- OssBucket
- DomainName
InstanceAppId:
Description:
en: Application server instance ID
zh-cn: 应用服务器实例ID。
Value:
Fn::GetAtt:
- EcsInstanceApp
- InstanceId
InstanceAppPublicIp:
Description:
en: Application server instance public network IP
zh-cn: 应用服务器实例公网IP。
Value:
Fn::GetAtt:
- EcsInstanceApp
- PublicIp
InstanceELKId:
Description:
en: Application server instance ID
zh-cn: 应用服务器实例ID。
Value:
Fn::GetAtt:
- EcsInstanceELK
- InstanceId
InstanceELKPublicIp:
Description:
en: Application server public network IP
zh-cn: 应用服务器公网IP。
Value:
Fn::GetAtt:
- EcsInstanceELK
- PublicIp
InstanceELKUrl:
Description:
en: Kibana's administrative interface
zh-cn: Kibana的管理界面。
Value:
Fn::Join:
- ''
- - http://
- Fn::GetAtt:
- EcsInstanceELK
- PublicIp
- :5601
InstanceVPNId:
Description:
en: VPN Server instance instance ID
zh-cn: VPN服务器实例实例ID。
Value:
Fn::GetAtt:
- EcsInstanceVPN
- InstanceId
InstanceVPNPublicIp:
Description:
en: VPN server instance public network IP
zh-cn: VPN服务器实例公网IP。
Value:
Fn::GetAtt:
- EcsInstanceVPN
- PublicIp
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- VpcCidrBlock
- VswCidrBlock
Label:
default: VPC
- Parameters:
- ImageIdVPN
- ImageIdELK
- ImageIdApp
- EcsInstanceType
- EcsPassword
Label:
default: ECS
- Parameters:
- BucketName
- DeletionForce
Label:
default: OSS
TemplateTags:
- acs:solution:备份&容灾:自建ElasticSearch快照备份OSS
ALIYUN::ROS::Designer:
03e32041-eed6-413c-8ab4-a57272248ce9:
embeds:
- 44000149-e23e-41a0-a1d6-a33af76c0aef
- cc6061af-e57f-4b06-848f-335f82956a03
- a3eb4ff3-9663-44f1-b771-d562d853703b
position:
x: 349
y: 108
size:
height: 402
width: 214
z: 1
114d8caf-9041-4c22-a8c5-21f82d937187:
embeds:
- 03e32041-eed6-413c-8ab4-a57272248ce9
- bfa8a058-ad24-4d06-9c4c-020bb180f1bb
position:
x: 204
y: 77
size:
height: 470
width: 375.0537109375
z: 0
44000149-e23e-41a0-a1d6-a33af76c0aef:
position:
x: 478
y: 292
size:
height: 60
width: 60
z: 2
644e1541-b00b-4635-84dd-819db763baa3:
position:
x: 640
y: 283
size:
height: 60
width: 60
z: 0
69101592-3363-4ead-9682-b7d1e843afcd:
position:
x: 641
y: 370
size:
height: 60
width: 60
z: 0
6b314593-fe35-43ae-afb5-672722fc3695:
position:
x: 641
y: 464
size:
height: 60
width: 60
z: 0
6cc37793-843d-467a-a79f-9ac2e2706e4b:
source:
id: cc6061af-e57f-4b06-848f-335f82956a03
target:
id: bfa8a058-ad24-4d06-9c4c-020bb180f1bb
z: 1
8130d753-6dd8-4b5e-9928-92eeaadeb7d9:
position:
x: 637
y: 104
size:
height: 60
width: 60
z: 0
8d3dff05-2439-4aa7-a8dc-8f72eab5911f:
source:
id: 44000149-e23e-41a0-a1d6-a33af76c0aef
target:
id: bfa8a058-ad24-4d06-9c4c-020bb180f1bb
z: 1
90b9f494-cb93-4afc-a372-83fade27cb20:
position:
x: 637
y: 193
size:
height: 60
width: 60
z: 0
a1a2df6c-4acf-488b-aaf4-313c2f3ef8bb:
source:
id: 90b9f494-cb93-4afc-a372-83fade27cb20
target:
id: 8130d753-6dd8-4b5e-9928-92eeaadeb7d9
z: 1
a3eb4ff3-9663-44f1-b771-d562d853703b:
position:
x: 478
y: 451
size:
height: 60
width: 60
z: 2
bfa8a058-ad24-4d06-9c4c-020bb180f1bb:
position:
x: 232
y: 292
size:
height: 60
width: 60
z: 1
cc6061af-e57f-4b06-848f-335f82956a03:
position:
x: 478
y: 131
size:
height: 60
width: 60
z: 2
ed1fa634-be92-4c78-bb0e-b6ea8b6d2dc9:
source:
id: a3eb4ff3-9663-44f1-b771-d562d853703b
target:
id: bfa8a058-ad24-4d06-9c4c-020bb180f1bb
z: 1
fc3402ee-0c4d-4e2e-b72a-6d25996ddcd7:
source:
id: 6b314593-fe35-43ae-afb5-672722fc3695
target:
id: 69101592-3363-4ead-9682-b7d1e843afcd
z: 1