A company runs a proprietary in-memory grid that requires updating /etc/cluster/nodes.config whenever cluster membership changes. Adding a node must be automated so the file lists the current member IPs and the service is restarted. What can a DevOps engineer do to automate this with minimal effort?
Choose an answer
Tap an option to check your answer.
Correct answer: Use AWS OpsWorks Stacks to model the cluster layer. Write a Chef recipe that generates /etc/cluster/nodes.config from the layer’s current instances and restarts the service, and run that recipe on the Configure lifecycle event..
Why this is the answer
The correct answer leverages AWS OpsWorks Stacks' ability to manage instance configurations and lifecycle events. OpsWorks layers represent logical groupings of instances, and the Configure lifecycle event is triggered when instances enter or leave the layer. A Chef recipe can be written to dynamically query the layer for its current instances, generate the nodes.config file with their IPs, and then restart the service. This approach automates the entire process with minimal effort and ensures consistency across the cluster. Keeping nodes.config under version control and using CodeDeploy is less efficient because it requires manual updates to the file and a full deployment cycle for every cluster change. Hosting the file in S3 with a cron job introduces polling overhead and potential delays in configuration updates. Using an instance user-data script only runs at launch and wouldn't react to subsequent cluster membership changes.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed