A company wants to use a grid system for a proprietary enterprise in-memory data store on top of AWS. This system can run in multiple server nodes in any Linux-based distribution. The system must be able to reconfigure the entire cluster every time a node is added or removed. When adding or removing nodes, an /etc./cluster/nodes.config file must be updated, listing the IP addresses of the current node members of that cluster. The company wants to automate the task of adding new nodes to a cluster.
What can a DevOps Engineer do to meet these requirements?
A. Use AWS OpsWorks Stacks to layer the server nodes of that cluster. Create a Chef recipe that populates the content of the /etc/cluster/nodes.config file and restarts the service by using the current members of the layer. Assign that recipe to the Configure lifecycle event.
B. Put the file nodes.config in version control. Create an AWS CodeDeploy deployment configuration and deployment group based on an Amazon EC2 tag value for the cluster nodes. When adding a new node to the cluster, update the file with all tagged instances, and make a commit in version control. Deploy the new file and restart the services.
C. Create an Amazon S3 bucket and upload a version of the etc/cluster/nodes.config file. Create a crontab script that will poll for that S3 file and download it frequently. Use a process manager, such as Monit or systemd, to restart the cluster services when it detects that the new file was modified. When adding a node to the cluster, edit the file's most recent members. Upload the new file to the S3 bucket.
D. Create a user data script that lists all members of the current security group of the cluster and automatically updates the /etc/cluster/nodes.config file whenever a new instance is added to the cluster
A
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
在這個問題中,該公司在AWS上為其專有企業級內存數據存儲使用網格系統,該系統能在任何基于Linux的發行版上的多個服務器節點上運行。題目要求提供一個自動化的解決方案,使得該網格系統可以在每次添加或刪除節點的時候自動重新配置整個集群;同時更新/etc/cluster/nodes.config文件,以列出當前集群上的所有節點的IP地址。
A. 正確。使用AWS OpsWorks Stacks來分層該集群的服務器節點。創建一個Chef食譜(recipe),該食譜根據當前層中的成員來填充/etc/cluster/nodes.config文件的內容,并重啟服務。將該食譜分配給“配置(Configure)”生命周期事件。該選項提供了一個相對直接和自動化的解決方案,利用OpsWorks和Chef自動化配置管理,能夠在集群配置發生變化時自動更新配置文件并重啟服務。這是實現公司需求的一個有效和高效的方法。
B. 不正確。將nodes.config文件放入版本控制中。創建一個AWS CodeDeploy部署配置和部署組,基于EC2實例的特定標簽值來標識集群節點。當添加新節點到集群時,更新文件以包含所有帶標簽的實例,并在版本控制系統中提交更改。部署新文件并重啟服務。這種方法利用了版本控制和 CodeDeploy,但更新和部署過程相對復雜,且需要手動更新文件。
C. 不正確。創建一個Amazon S3桶并上傳 /etc/cluster/nodes.config 文件的版本。創建一個crontab腳本,定期輪詢S3中的文件并下載。使用進程管理器(如Monit或systemd)來檢測文件是否被修改,并在檢測到修改時重啟集群服務。當添加節點到集群時,編輯最新的文件成員,然后上傳到S3桶。這種方法依賴于外部存儲(S3)和定時任務,可能導致配置延遲和額外的復雜性。
D. 不正確。創建一個用戶數據腳本,該腳本列出當前集群安全組中的所有成員。每當向集群添加新實例時,自動更新 /etc/cluster/nodes.config 文件。這種方法依賴于安全組信息,但安全組通常不包含實例的詳細IP信息,而且用戶數據腳本在實例啟動時運行一次,可能無法實時反映集群變化。