Topic 1 Question 181
You have a Compute Engine managed instance group that adds and removes Compute Engine instances from the group in response to the load on your application. The instances have a shutdown script that removes REDIS database entries associated with the instance. You see that many database entries have not been removed, and you suspect that the shutdown script is the problem. You need to ensure that the commands in the shutdown script are run reliably every time an instance is shut down. You create a Cloud Function to remove the database entries. What should you do next?
Modify the shutdown script to wait for 30 seconds before triggering the Cloud Function.
Do not use the Cloud Function. Modify the shutdown script to restart if it has not completed in 30 seconds.
Set up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log message arrives in Cloud Logging.
Modify the shutdown script to wait for 30 seconds and then publish a message to a Pub/Sub queue.
ユーザの投票
コメント(16)
Actually C is correct but Wrong also in a way .. Sink cannot trigger a cloud function directly. It need Pub/Sub which then will trigger Cloud Function.
👍 7Tesla2022/10/28- 正解だと思う選択肢: C
C is the answer as shutdown script is run based on best effort and not a reliable method.
https://cloud.google.com/compute/docs/shutdownscript#limitations Compute Engine executes shutdown scripts only on a best-effort basis. In rare cases, Compute Engine cannot guarantee that the shutdown script will complete.
👍 5zellck2022/09/14 - 正解だと思う選択肢: C
C would be the cleanest solution. Although at this time, Cloud Monitoring sink cannot trigger a cloud function directly, it can be done via Pub/Sub. Still better than solution D.
👍 4kuboraam2022/09/07
シャッフルモード