84
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar https://amzn.to/JPWebinar https://amzn.to/JPArchive EC2 2019-03-06 Amazon EC2 [AWS Black Belt Online Seminar]

[AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

AWS ��Webinarhttps://amzn.to/JPWebinar

��� https://amzn.to/JPArchive

�����������������EC2� ����������2019-03-06

Amazon EC2�������������� ����

[AWS Black Belt Online Seminar]

Page 2: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����

���� (����)���������� � / EC2�����������������&( "��EC2����������#'$%

��� �EC2�����������+����*�!)������

���AWS��• Amazon EC2 Auto Scaling• AWS Support

Page 3: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

AWS Black Belt Online Seminar ��

���( =��#0-��.1=��4:=�� ����%�*�<�����*$1��)��( �,'13628�95���1/�1"+&��0�!���

7>�;��������••

S

Twitter #awsblackbelt

Page 4: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������

• [=a��2019T366R>N�#�'%Q^���./����J\���� �9F�EZ�AWS7?!"(# &(http://aws.amazon.com/)��0S����

• =a;G��BXM,����� ��=aQ�./�AWS7?!"(# &1:�./�L-����D8�AWS7?!"(# &�./�]K��������� �

• ./�IUW1������ �R[4A@��2_�P5*�$)+�<` �D8�YOCVI�H3�������� �

• AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.

Page 5: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������

• �)!$�1��1��;F( )72�( )�OD��• �1 &��1

• +!( )-1�."��/• �"( )$'/

• IGJH��1��1�,�#������CloudWatch ( )�AL• >������

• �"( )$0� : CE�@� ��• ( )54N• ( )9:• Q=�P( )��1��1���(�8R• (M<��)�B( )36����1#*1%36�?K

Page 6: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���� ����� � ����

Page 7: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���� - Amazon EC2������

A 10 (

2 //

/ nEC

)%

/ /

(/

o 3 z

/ /

m a1 1

Page 8: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

E 2 C

C

CC

������������

Page 9: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

Amazon EC2�����������

����• 7<930• >=6�,��+��7A -"�������-� �HPC/�(���*-�(-�

�������• /C�(�����

1,000;.9�4D2E• &!�'-��-��)• GB1��API��@

5

� ��• /C�(������-�&-��(��#���%���� �8?2E

• F:��-��-���$�8?2E

Page 10: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������� �����

Page 11: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����� - 110���������

• z ig(s lw)• vn z

: cu• cu AWS

tm•

• 2017 8h26 ravCPU 110( y)

• ebp

• o ( )22/1 1 .- . . 1 1 - 2 - / . 11 -2 1.- - 1 2 .- / 1 1/.2 -12 - 1

Page 12: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����� - 110���������

• i(u mny)• z p l

ew• ew AWSb vo

•• 2017 8 26 tc

vCPU 110(a )

• : : : : gr h

• ( : ): s

22/1 1 .- . . 1 1 - 2 - / . 11 -2 1.- - 1 2 .- / 1 1/.2 -12 - 1

Page 13: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�������������

H L I NR 5 / H FGT

0 D) 2

F 2 I P

2

7 D2 C DC DcA ad

C A

8 3D

( 2% I PDD /

50877 D) 2(

( E 2Y a % da &

Page 14: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������������

• 1/42�0��$��'.�)� �*�-��,��• ���!��(�.(�.�(.���'.)

• ����"�.��3���������*�-��,��• #*� +�&����%����

Page 15: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����AWS���OSS, ��� �

AWSCloudFormation

AWSOpsWorks

Amazon EMR

Amazon ECS

AWS Data Pipeline

AWS BatchAuto Scaling

AWS ThinkboxDeadline

Page 16: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������� �

Page 17: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������� - 201711

�������

Page 18: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �(1)

1 ) 41- 1 ) 1

. )

�. ) ( . )

1 ) 4 (

. )

�. ) ( . )

Page 19: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �(2)

1 ) 41- 1 ) 1

. )

�( . )

1 ) 4 (

. )

�( . )

��� ���

���

���

. )

���

. )

���

Page 20: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �(3)

4 .,(4 4 ,- 4

1 -,

�1 -,

4 .,

1 -,

�1 -,

� �

1 -,

1 -,

������� T R T ) A

Page 21: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �(4)

1 ) 41- 1 ) 1

. ) ( . )

1 ) 4 (

. ) ( . )

10 10

10

10

. )

10

. )

10

$

.R

$

Page 22: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�������������(1)

6 4 - 1 )-.0 4

2 .- 2 .-

143 143

2 .-

143

$

20. o m ks i Race

g lce r y

• h2 .-

• T p ce nt ks $ ($

o

.

Page 23: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�������������(2)

- 67 1 - - 73 7 0276

( 4- 0 .( 4- 0

021 021

( 4- 0

021

$

R T R T c keR T R R gr

• n - .( 4- 0 ao• hm R T

$ $ $ )$p

• R T c

R l isao

.

Page 24: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�����������(1)

4 -1 )-. 4

2 .-

$2 .-2 .-

4 ( C e T T ET T Ce A

• a RT2 .-C

c C

Page 25: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�����������(2)

- 7 1 - - 73 7 027

5( 4- 0 .( 4- 0

042 042

( 4- 0

042

)(

hg R i T

• c - .( 4- 0R

• R $ $ $

• R $ $$ $ )$

1. 3$

e a

Page 26: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������������� �

• "($&�*"#*"�+-�@/10�7E�.���8��?:���

• "($&�*"#*"� AWS ����><�������� �4�� 2 C;���A=���• Amazon EC2�2� )'!%��5D��������• 6B��+-(�93+-�)�"($&�*"#*"+-�9,����

Page 27: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����

Page 28: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����

• ������������������2!�� �• �� ������

• �����������• CloudWatch Events

Page 29: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����� � -����������

• ��������������• �)� ��������"/�%$�+�• http://169.254.169.254/latest/meta-data/ ����,��• https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/ec2-

instance-metadata.html• )&*(

• http://169.254.169.254/latest/meta-data/spot/instance-action ��,��

• .'�• 5-��������#!• https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/spot-

interruptions.html

Page 30: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������

{

"version": "0",

"id": "12345678-1234-1234-1234-123456789012",

"detail-type": "EC2 Spot Instance Interruption Warning",

"source": "aws.ec2",

"account": "123456789012",

"time": "yyyy-mm-ddThh:mm:ssZ",

"region": "us-east-2",

"resources": ["arn:aws:ec2:us-east-2:123456789012:instance/i-1234567890abcdef0"],

"detail": {

"instance-id": "i-1234567890abcdef0",

"instance-action": "action"

}

}

Page 31: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������ - CloudWatch Events��

. / . - . / / . / / / / 22 / /

Page 32: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������ - CloudWatch Events��

Page 33: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������

Page 34: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������

�� AWS CLI

(aws ec2 ...)

������

������� ���

�!��

����� ��������

(EC2)

run-instances(request-spot-

instances)

one-time (sync) /persistent (sync)

request-spot-fleet /

vCPU ( )request (async) / maintain (async)

EC2 create-fleet / vCPU ( )

instant (sync) / request (async) / maintain (async)

Auto Scaling(New!)

- ,-

Page 35: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

m4.large Spot ASG Min: 1 Max: 10

m5.large Spot ASG Min: 1 Max: 10

c4.xlarge O-D ASG Min: 1 Max: 10

Availability Zone 1

Availability Zone 2

Availability Zone 3

- C ACASG

ASG 2E

- CC2ASG E

ASG: Auto Scaling GroupO-D: On Demand Instance

Page 36: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

2 / - E DE S C C G R

m4.large Spot Instances

m5.large Spot Instances

c4.xlarge On-Demand instances

Availability Zone 1

Availability Zone 2

Availability Zone3

ASG SOGAI S

C CG R

Single ASG

ASG: Auto Scaling GroupO-D: On Demand InstanceRI: Reserved Instance

Page 37: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����

Page 38: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������

�� AWS CLI

(aws ec2 ...)

������

������� ���

�!��

����� ��������

(EC2)

run-instances(request-spot-

instances)

one-time (sync) /persistent (sync)

request-spot-fleet /

vCPU ( )request (async) / maintain (async)

EC2 create-fleet / vCPU ( )

instant (sync) / request (async) / maintain (async)

Auto Scaling(New!)

- ,-

Page 39: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�����������

Page 40: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(1)

Page 41: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(2)

������' ����������%*���!��!�����&+�)"�����• Load balancing: $�������!��!������'(• Flexible workloads: ����#��!��!������'(

Page 42: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(3)

�!����������������"���# � ��• ��#���vCPU��� � • ��������������!��������������$ �

Page 43: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(4)

• �% "$'�"�-;��% "�(��(��>?��75���vCPU 0:�

• �% "$'�"�*=��(!&(#�(��(� .6 ��

• ���� ">?�)1����� ��<����98�� 0:>?�+,��3/��% "$'�"�2; 4��(��(��-;�

Page 44: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(5)

• *2�1��� EC2�"���� ������$��$���!�02�'%�4,���

• ��'%����#����.)��/-+(�35������&

Page 45: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(6)

• ������$���$��'��������%�• ���� !������#�&����• (" �������

Page 46: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

EC2 Auto Scaling Group���(1)

• EC2����������EC2 Auto Scaling������� ����������� ���!���

Page 47: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

EC2 Auto Scaling Group���(2)

Page 48: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

EC2 Auto Scaling Group���(3)

• �"+����� �������'�#�����&(�.!�#�����������-%&(�

• *�������$)���� ��,

Page 49: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

EC2 Auto Scaling Group���(4)

• 2/�,�7• 1. 01/���&�!����• 2. �����!�%'��'�$' "����2/��'�$' �*4

• 3. .���"���3���'�$' )-����� 65

• 2/�,�7�8• ��&�!�����12• ��!�%'��'�$' "����2

• �"���3���'�$' )-��30:70

• +(• �'�$' 22+32• �#��72

Page 50: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

<��> EC2 Auto Scaling�Spot Fleet��� (1)

(: EC2 Auto Scaling Spot Fleet

'>?@�&/ � �09���$%� � �

<4AZ�.8 � �<4�%��%��� �.8 � ��%�"%��%��%��*+ � [1]

1. 564�Total target capacity2. ����"Optional On-demand portion�74��%�"%��)93. -���!���)9

� [2]1. 564�Desired Capacity2. ����"On-Demand base"�74��%�"%��)93. -��OD:Spot Ratio ���=;

ELB����#����13 � �Launch Template$latest, $default��,2

� �

[1] https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/spot-fleet.html#on-demand-in-spot[2] https://docs.aws.amazon.com/ja_jp/autoscaling/ec2/userguide/AutoScalingGroup.html#asg-purchase-options

Page 51: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

• ,9���� (Termination Policy)• �� ��8& (Termination

Protection)• ��������• !*4� �� ��(-

(Entering Standby)• � �� ������10

(Suspending Processes)• ��������'7) (Rebalancing

activities)

<��> EC2 Auto Scaling�Spot Fleet�� (2) -���

• ����� ���#;• 6/ �� ����3+

• .2:$(����*)���(%"(5+*)�3+

Page 52: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�������������

�� –��1 ��

�� –��1 �

������������

60!)7� =%5-� 60!)7� 60!)7�*#0!)7� =%5-� *#0!)7��

(&�1*#8�=%5-�

*#0!)7�

• $4���� ������� �� �=%�./����"31��=%�2<���

• $4&�1*#0!(�� �� �*#�) =%94�;:������94���+'��� �� �*#��,�=%�2<���

Page 53: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (� ����)

2 ==

$ $

( (=

=

) )) )

= 43 2 1 =

Page 54: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (� ����)

1$ $

4

( (( (

) 3= 2 1

Page 55: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (� ����)

() 1 =31= =

1=

=

1=

=

$

2= =

(

Page 56: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (�� ����)

=

3 5= 3

21

$ $

1 =

3

= 3

( (( (

4

) =3

Page 57: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (�� ����)

3 53

) 21

$ $

1 3

3

4 =

(3

Page 58: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ (�� ����)

() 1 =31= =

1=

=

1=

=

$

2= =

(

Page 59: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������������ �����

• � - Amazon EC2 ���������� - Amazon EC2 | AWS https://aws.amazon.com/jp/ec2/spot/pricing/

Page 60: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �����(1)EC2� �������������������������

Page 61: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� �����(2)AWS CLI: describe-spot-price-history

$ aws ec2 describe-spot-price-history --instance-types m3.medium{

"SpotPriceHistory": [{

"Timestamp": "2019-03-04T21:36:38.000Z","AvailabilityZone": "ap-northeast-1a","SpotPrice": "0.109600","ProductDescription": "SUSE Linux","InstanceType": "m3.medium"

},{

"Timestamp": "2019-03-04T21:36:38.000Z","AvailabilityZone": "ap-northeast-1c","SpotPrice": "0.109600","ProductDescription": "SUSE Linux","InstanceType": "m3.medium"

},:

Page 62: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

Page 63: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��� �� ��������(�����)

On Demand Auto-Scaling group

Output S3 bucket

Availability Zone A

Availability Zone BSpot Fleet

Upload object into input S3

bucket

Job SQS Queue

Auto Scaling group and Spot fleet scale up based on queue depth and scale down based on CPU utilization

CW metrics

Workers will check for jobs in the queue

Workers will update Job status (start time, SLA end time, etc) in

DynamoDB

Uploads to S3 will trigger a Lamda function to put

jobs in SQS and DynamoDB

EFSEC2 instance worker fleet

Cost-effective Batch Processing with Amazon EC2 Spot | AWS Compute Blog https://aws.amazon.com/blogs/compute/cost-effective-batch-processing-with-amazon-ec2-spot/

Page 64: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

AWS Batch�������(�)

JobQueuesubmit-joblist-jobsdescribe-jobscancel-jobsterminate-jobs

Compute Environment

ECR/DockerRegistry

S3/EFS/NFS

Autoscaling��ECS��

�������������

�����

Docker Image

JobDefinition

�����

��������

job ����AWS Batch

Page 65: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��� ����������������

Master Node (OD

or RI)

S3

EMRFS

Master Fleet

Task Node (Spot)

Task Node (Spot)

Task Node (Spot)

Task Fleet

Instance Store

EBS Volume

Instance Store

EBS Volume

Instance Store

EBS Volume

Core Fleet

HDFS

Instance Fleet

Core Node (OD or RI)

Core Node (OD or RI)

Core Node (OD or RI)

Amazon EMR

Page 66: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

����������� ������������

Stateless Web Server (Spot)

Stateless Web Server (Spot)

Session State Data

Stateless Web Server (On-Demand)

Elastic LoadBalancing

Amazon EC2 Auto Scaling

ECS container 1

Stateless Web Server (On-Demand)

ECS container 2

ECS container 1

ECS container 2

https://github.com/awslabs/ec2-spot-labs/tree/master/workshops/ec2-spot-fleet-web-app

Page 67: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

<��> ECS� ����������������������������

• c j ECS ga• ECSS_ _ eh i d E A

(/etc/ecs/ecs.config)• ECS AMI C

. . / / - - // /

. . / / - : / - /

Page 68: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

<��> ECS��������� �� ��������������� (��)�• ie do cha

• _ _ _ Draining E• ( S _)SNS lj

•→ ilj gC mnA

: . . : / / - - - - - /

Page 69: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

<��> ECS�������� ��������������������������

• CloudFormation

•• :

Draining• SNS E

. - - - - .2 .- / -2/ - 2 / - .-

Page 70: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

�� ������������

Page 71: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������� ����4+1��

���� ��7; 3���

1)(<"��!���$91)

>2�=8����������#�=8�#��#���

��+@

:.0�4?%,�-5&

�6/'*���#��#��#��#�'*

Page 72: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������� ����4+1�� -��

• z ig(s lw)• vn z

: cu• cu AWS

tm•

• 2017 8h26 ravCPU 110( y)

• ebp

• o ( )22/1 1 .- . . 1 1 - 2 - / . 11 -2 1.- - 1 2 .- / 1 1/.2 -12 - 1

Page 73: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��������� ����4+1�� -��

4 .,(4 4 ,- 4

1 -,

�1 -,

4 .,

1 -,

�1 -,

� �

1 -,

1 -,

������� T R T ) A

Page 74: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

��� �����������

Page 75: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

������� AWS Auto Scaling2019���- ����

������� AWS Auto Scaling 2019 � | ���� http://blog.father.gedow.net/2019/02/05/aws-auto-scaling-2019/

��� 2019�����

Page 76: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

EC2 Spot Instances Workshops

https://ec2spotworkshops.com/

Page 77: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(��)

• �)!$�1��1��;F( )72�( )�OD��• �1 &��1

• +!( )-1�."��/• �"( )$'/

• IGJH��1��1�,�#������CloudWatch ( )�AL• >������

• �"( )$0� : CE�@� ��• ( )54N• ( )9:• Q=�P( )��1��1���(�8R• (M<��)�B( )36����1#*1%36�?K

Page 78: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

���������(���)

• �)"%�1� 1��=J972�MK�SG��• �1!' �1

• +"�-1�.#��/• �#�%(/

• MKNL��1� 1�, $� ����CloudWatch Events�CP• @������

• �#�%0� : EI�B� ��• <54R• H9;• U?�TF��1� 1��8V• (Q>��)�D:36����1$*1&36�AO

Page 79: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

Q&A

���������"�����AWS Japan Blog �https://aws.amazon.com/jp/blogs/news/����#���! ��� ������

Page 80: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

https://amzn.to/JPWebinar3 �� Black Belt Online Seminar ����

3/5 ( ) 12:00-13:00 Amazon EC2

3/6 (�) 18:00-19:00 Amazon EC2��������3/12 ( ) 12:00-13:00 AWS Well-Architected Framework ��������3/13 (�) 18:00-19:00 Amazon VPC

3/19 ( ) 12:00-13:00 Amazon FSx for Windows File Server/Lustre

3/20 (�) 18:00-19:00 Amazon EBS

3/26 ( ) 12:00-13:00 Amazon CloudWatch

Page 81: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

AWS ��� �����AWS ����

https://amzn.to/JPArchive

Page 82: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

[ ����] AWS Innovate ��������

https://amzn.to/AWSInnovateJP

Page 83: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

. / . .- a i m

rh a i m o• [ W

ld m A ]p

• jc WbnS W/ : . .

( e)W

Page 84: [AWS Black Belt Online Seminar] Amazon EC2 · 2019-06-13 · © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Webinar

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

AWS ��Webinarhttps://amzn.to/JPWebinar

����https://amzn.to/JPArchive

�� ���������