AWS OpsWorks Configuration for Scaling Distributed Systems

Configuring AWS OpsWorks for Dynamic Scaling

Prev Question Next Question

Question

You have been tasked with deploying a scalable distributed system using AWS OpsWorks.

Your distributed system is required to scale on demand.

As it is distributed, each node must hold a configuration file containing the hostnames of the other instances within the layer.

How should you configure AWS OpsWorks to manage scaling this application dynamically?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - A.

Please check the following AWS DOCs which provides details on the scenario.

Check the example of "configure".

https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-events.html

You can use the Configure Lifecycle event.

This event occurs on all of the stack's instances when one of the following occurs:

An instance enters or leaves the online state.

You associate an Elastic IP address with an instance or disassociate one from an instance.

You attach an Elastic Load Balancing load balancer to a layer or detach one from a layer.

Ensure the Opswork layer uses a custom Cookbook.

For more information on Opswork stacks, please refer to the below document link: from AWS.

http://docs.aws.amazon.com/opsworks/latest/userguide/welcome_classic.html
2. Toggle Use custom Chef cookbooks to Yes.

Use custom Chef cookbooks {2%

Repository type Git ’
Repository URL hitps://github.com/awslabs/op:
Repository SSH key Optional
Branch/Revision Optional

Stack color BEBE EEEe

The correct answer is C: Create a Chef Recipe to update this configuration file, configure your AWS OpsWorks stack to use custom cookbooks, and assign this recipe to execute when instances are launched.

Explanation: AWS OpsWorks is a configuration management service that provides managed instances, layers, and applications. It allows you to automate the deployment of applications, manage configurations, and monitor resources using Chef recipes.

To configure AWS OpsWorks for the given task, we need to create a Chef recipe that updates the configuration file containing the hostnames of other instances within the layer. This recipe can be created using ChefDK, which is a development kit for creating and testing Chef recipes.

Once the recipe is created, it needs to be added to a custom cookbook and uploaded to AWS OpsWorks. This cookbook can then be assigned to the specific layer that requires the configuration update.

To ensure that the recipe is executed when new instances are launched, we need to assign it to the "Setup" lifecycle event. The "Setup" event is triggered when an instance is launched or when an instance joins a layer. This event allows us to execute our recipe and update the configuration file with the correct hostnames.

Option A is incorrect because it assigns the recipe to the "Configure" lifecycle event, which is triggered after the instance has been launched and configured. It is not appropriate for updating configuration files that require dynamic updates.

Option B is incorrect because it requires the use of a custom script to poll the AWS OpsWorks service API for new instances. This is a manual and error-prone approach that does not leverage the automation capabilities of AWS OpsWorks.

Option D is incorrect because it relies on the AWS-provided recipe for distributed host configuration. This recipe does not provide the flexibility to update configuration files dynamically and requires manual configuration of the instance hostname and file path parameters.