Friday, March 10, 2017

EC2 Automatic-recovery

1 Introduction

1.1 Why we need self-healing feature for EC2?

Based on the SLA provided by Amazon, the availability of the EC2 and EBS is between 99% to 99.5%, it is a far cry for SLA with 99.999% availability we had seem for on-premise data centers. I am not saying AWS is unreliable, this is what it is for any public cloud, you just need to set up your environment to anticipate failure, even for on-premise data center.

1.2 What are the solutions?

There are two ways to handle EC2 failure automatically:
  • Setup up auto-scaling with one instance in the group
  • Setup EC2 auto-recovery

Auto-Recovery is much cheaper (or even no-cost if you use 5 minutes sample time for cloud watch) and easier to set up then using auto-scaling group.

1.3 What is auto-recovery?

Auto Recovery is an Amazon EC2 feature that is designed to increase instance availability. This feature can be used to recover instances automatically when the system shows some unhealthy condition due to impairment.

1.4 What might trigger an auto-recovery?

The following is some of the problems that will trigger activate auto-recovery:

  • Loss of network connectivity
  • Loss of system power
  • Software issues on the physical host
  • Hardware issues on the physical host that impact network reachability

1.5 How EC2 Auto-recovery works?

Auto-recovery is not set up by default, so you must set up first, I will describe the process in later sections.

Assuming you had already set up auto-recovery on your EC2 instance, auto-recovery will works in the following manner:

  1. The EC2 instance fails for one of the previously described reasons.
  2. CloudWatch monitor the EC2 instance and detect failure.
  3. A CloudWatch triggers the recovery of the EC2 instance.
  4. A new EC2 instance will be launch on new hardware to replace the failed one. The new EC2 instance is a clone of the failed EC2 instance. The ID, the private and public IP addresses will stay the same. As long as data is stored on EBS volumes, no data is lost.

The following diagram illustrate the process:

1.6 Restrictions

The recover action is supported only on instances with the following characteristics:
  • Use a C3, C4, M3, M4, R3, R4, T2, or X1 instance type
  • Run in a VPC (not EC2-Classic)
  • Use shared tenancy (the tenancy attribute is set to default)
  • Use EBS volumes, including encrypted EBS volumes (not instance store volumes)
  • If your instance has a public IPv4 address, it retains the public IPv4 address after recovery.

2 How to Enable Automatic-recovery of EC2 instance

AWS Cloudwatch is used to monitor the instances and auto-recovery in case of any type of impairment of the system. Whenever status check fail occurs, the recovery action takes place.

Following is the steps to setup EC2 auto-recovery:
  • Login to AWS console, go to EC2 dashboard,
  1. select the EC2 instance you want to setup auto-recovery.
  2. Click on the  monitoring tab
  3. “Create Alarm.”
      
  • On the Create Alarm screen
  1. On “Take the Action” checkbox choose “Recover this instance”.
  2. Make it  “1 consecutive period(s) of 5 minutes” to avoid detail CloudWatch charges. (Note: if this instance is critical and the cost become not important, we should use “2 consecutive periods of 1 minutes)
  3. Click “Create” button.
      

  • Click close

Now, the instance has been set up to Auto-Recovery. The instance will be automatically recovered in case of any system impairment.

3 Reference

29 comments:

  1. Nice Info Regaring Automatic recovery of ec2 my sincere thanks for sharing this post Please continue to share this kind of post
    AWS Training in BTM Layout || AWS Training in Marathahalli

    ReplyDelete
  2. What if the region is down? Would auto-scaling be a better option?

    ReplyDelete
  3. Thanks for providing your wonderful information for more updates on AWS Get touch with AWS Online Course

    ReplyDelete
  4. Nice Blog. Very interesting, Thank you for sharing
    aws training in chennai

    ReplyDelete
  5. Data science Training Institute in Noida

    Webtrackker Data science Training Institute in Noida Accelerate your career in data science by starting from basics in Statistics, Data Management and Analytics to advanced topics like Neural Networks, Machine Learning and Big Data.



    http://webtrackker.com/Best-Data-Science-Training-Institute-in-Noida.php



    Data science Training Institute in Noida

    OUR OTHER COURCES

    SAS Training center in Delhi


    Best Software Testing Training Institute in delhi

    Best Salesforce Training Institute in delhi

    Best Python Training Institute in delhi



    ReplyDelete
  6. 3D Animation Training in Noida

    Best institute for 3d Animation and Multimedia

    Best institute for 3d Animation Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.

    3D Animation Training in Noida

    Company Address:

    Webtrackker Technology

    C- 67, Sector- 63, Noida

    Phone: 01204330760, 8802820025

    Email: info@webtrackker.com

    Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php


    ReplyDelete
  7. Latest News in Hindi

    Latest News in Hindi- Hindustan channel is the best online web portal in india where you read the all latest indian news in hindi. if you are looking the Latest News in Hindi, live news channel, hindi news channel, live news channels in hindi, live hindi channels then hindustan channel is best for you.
    Latest News in Hindi

    Company address:
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025


    URL: https://hindustanchannel.com

    ReplyDelete
  8. PCB Design Training in Bangalore offered by myTectra. India's No.1 PCB Design Training Institute. Classroom, Online and Corporate training in PCB Design
    pcb design training in bangalore

    ReplyDelete
  9. I really appreciate for your hard work to make things easy to understand. Really many students struggling to understand certain concept. For more information please visit our web site........
    myTectra offers corporate training services in Bangalore for range of courses on various domain including Information Technology, Digital Marketing and Business courses like Financial Accounting, Human Resource Management, Health and Safety, Soft Skill Development, Quality & Auditing, Food Safety & Hygiene. myTectra is one of the leading corporate training companies in bangalore offers training on more than 500+ courses
    corporate training in bangalore
    top 10 corporate training companies in india
    along these we are going to help the professionals and students to crack their interview with interview questions and answers look a head into sites you might be like....
    spring interview questions
    jsp interview questions

    ReplyDelete
  10. Excellent article. Very interesting to read. I really love to read such a nice article. Data Science Online course


    ReplyDelete
  11. Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
    python Training institute in Pune
    python Training institute in Chennai
    python Training institute in Bangalore

    ReplyDelete
  12. Sap fico training institute in Noida

    Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.


    WEBTRACKKER TECHNOLOGY (P) LTD.
    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025
    0120-433-0760
    0120-4204716
    EMAIL: info@webtrackker.com
    Website: www.webtrackker.com

    ReplyDelete
  13. Thanks For Sharing The Information The information Shared Is Very valuable Please keep updating us Time Just Went On reading The article Python Online Course AWS Online Course Devops Online Course DataScience Online Course

    ReplyDelete
  14. Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
    If you are looking for any Data science Related information please visit our website Data science courses in Pune page!

    ReplyDelete
  15. Hi,Very nice post.Thanks for the information provided.It is very interesting and very informative.I am always impressed with your post and helpful tips.Keep posting tips and relevant content as usual.
    Tableau training in btm

    ReplyDelete
  16. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    AWS Online Training
    AWS Certification Training
    AWS Certification Course Online
    AWS Training
    AWS Online Course

    ReplyDelete
  17. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us,,keep it up!!!

    android training in chennai

    android online training in chennai

    android training in bangalore

    android training in hyderabad

    android Training in coimbatore

    android training

    android online training

    ReplyDelete
  18. PLC training in noida offers by DIAC and get the opportunity to be the part of Automation Industry. We are nominated best PLC training Institute in Delhi with 100% placement record. More@9953489987, 9711287737.

    ReplyDelete
  19. Getting into Integrated Marketing is tough if you don’t have thorough knowledge. Then why not join Talentedge, the first ed-tech platform that has joined hands with XLRI and MICA to provide the best courses to the students.

    ReplyDelete