About Automatic Recovery of Instances Using Amazon CloudWatch Logs

Asked 2 years ago, Updated 2 years ago, 390 views

While solving the solution architect's problem book, I could not find the answer to the following questions.

Amazon Applications running on the EC2 instance are periodically stopped and restarted to restore operations.The application logs are printed to Amazon CloudWatch and the logs that cause the problem are identified.The developer is working on fixing the bug, but there is no fixed time for fixing them.Select a workaround to automate instance recovery until the fix is deployed.

A: Create an Amazon CloudWatch alarm for the memory usage of the instance.Triggers an Amazon CloudWatch action based on the alarm you created and restarts the instance.

< p > B : specified log As the dotCloud, Amazon Cloud Watch < / > In Last filter set to Amazon Cloud Watch to create alarm.Amazon Cloud and on the basis of the alarm Amazon Watch an instance as a trigger in the action will need to reboot. < / >

The answer seems to be B, but I didn't understand why A was incorrect.
Since B is a better answer, is B the correct answer (A is not a mistake)?

If you know why A is incorrect, I would appreciate it if you could reply.

aws aws-cloudwatch

2022-09-30 22:01

2 Answers

The problem statement only says "Applications stop processing periodically" and does not mention memory usage.

Create an Amazon CloudWatch alarm for the memory usage of the instance

There is no guarantee that can be achieved.


2022-09-30 22:01

Increasing memory usage does not necessarily mean that the application is down, or at least there is no identifiable statement.
Therefore, in case A, there is a possibility that it will restart when there is no problem.

On the other hand, the problem statement is

Problem logs have been identified

It says , so you can read that you can see exactly when the problem occurred by looking at the log.
Therefore, B is more appropriate.

By the way, CloudWatch does not have a memory usage metric for EC2 instances by default, and if you want to check it on CloudWatch, you need to send it to CloudWatch Agent and so on.


2022-09-30 22:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.