구글 프로페셔널 클라우드 아키텍트 자격증 대비 교육자료 (4편) [Google Professional Cloud Architect]

구글 클라우드 자격증 중 하나인 Google Cloud Certified - Professional Cloud Architect 를 취득하였습니다. 공부 자료가 많지 않고 전부 영어로 되어 있어서 클라우드 아키텍트 자격증을 준비하시는 분들께 조금이라도 도움을 드리고자 준비해보았습니다. 

  • Your company has reserved a monthly budget for your project. You want to be informed automatically of your project spend so that you can take action when you approach the limit. What should you do?  
A. Link a credit card with a monthly limit equal to your budget.
B. Create a budget alert for desired percentages such as 50%, 90%, and 100% of your total monthly budget.
C. In App Engine Settings, set a daily budget at the rate of 1/30 of your monthly budget.
D. In the GCP Console, configure billing export to BigQuery. Create a saved view that queries your total spend.

회사가 프로젝트 예산을 잡았는데, 프로젝트 사용요금이 예산을 초과하려고 하면 자동적으로 알림을 받고자 한다. 어떻게 하면 되냐? 는 문제입니다. 월별 내가 낼 수 있는 비용보다 금액이 많이 발생하기 전에 내가 정한 구간에 도달하면 알림을 받아보게 하는 기능이 GCP에 있습니다. Billing > Budgets & alerts 메뉴에서 만들 수 있고 내가 알림 받고자 하는 프로젝트와 프로덕트를 설정한 후 예산 몇 프로(%) 에 이르면 알림을 받을지 선택할 수 있습니다. 예산 또한 입력해야 합니다. 아래 이미지에서는 예산 50%, 90%, 100%에 도달할 때 알림을 각각 받을 수 있게 설정되어있습니다.

Budgets & alerts 메뉴

Create Budget 버튼을 누르고 생성

알림 받을 구간을 설정

그래서 결국 정답은 B입니다. 내 월별 budget에서 50%, 90%,100% 처럼 내가 원한 비율에 도달하면 알람을 받게 생성할 수 있습니다. 

  • Your organization is going to use Cloud SQL as the database backend for a large web application. You will be using a failover instance and are able to support small maintenance windows of downtime for updates. Your scaling requirements are as follows:
  1. Do not run out of storage/disk space
  2. Keep average CPU usage under 80%
  3. Keep replication lag under 60 seconds
Based on these requirements, how should you set up your Cloud SQL environment?

A.Provision your instance with a 50 TB persistent disk to ensure you have enough space.
  Create an alert in Stackdriver for replication lag and shard the database to reduce replication time.
  Use a 64-core machine type to make sure you have enough CPU capacity.

B.Enable the automatic storage increase feature for your Cloud SQL instance.
  Create an alert in Stackdriver when CPU usage exceeds 80% and change the instance type to reduce CPU usage.
  Create an alert in Stackdriver for replication lag and shard the database to reduce replication time.

C.Enable the automatic storage increase feature for your Cloud SQL instance.
  Create an alert in Stackdriver for replication lag and increase the CPU count to reduce replication lag time.
  Create an alert in Stackdriver when CPU usage exceeds 80% and change the instance type to reduce CPU usage

D.Enable the automatic storage increase feature for your Cloud SQL instance.
  Create an alert in Stackdriver for replication lag and use Memcache to reduce replication time.
  Create an alert in Stackdriver when CPU usage exceeds 80% and change the instance type to reduce CPU usage.

데이타베이스 백엔드로 Cloud SQL을 사용할 계획이고 failover 인스턴스도 사용할 것이다. 스케이링 요구사항은 1. 저장소/디스크 공간이 부족하면 안되고 2. CPU 사용량이 80% 이하를 유지 3. 복제 렉(lag) 이 60초 아래로 유지.  Cloud SQL 환경을 어떻게 설정하면 되냐?는 문제입니다.  Cloud SQL에는 자동으로 스토리지(storage)를 늘려주는 기능이 있습니다. (Enable automatic storage increase 이미지 참고) Stackdriver는 구글 클라우드 플랫폼과 아마존 웹 서비스에서 로그를 저장하고 검색하고 분석하고 모니터링하고 Alerting합니다. Stackdriver Monitoring 서비스에서 CPU usage에 조건을 설정하여 모니터링하고 Alert를 보낼 수 있습니다. 또한 replication lag도 모니터링하여 alert 할 수 있습니다. (이미지 참고) 

자동으로 용량을 늘려주는 기능


Stackdrive Monitoring > Alerting 메뉴 화면

Stackdriver Monitoring 에서 CPU 사용량 기준 Alert 생성


replication lag 을 Target으로 설정하는 예

로그, 모니터링, 트레이스(trace), 디버그(debug)와 같은 키워드들이 나오면 Stackdriver를 떠올리시고 조금 더 깊게 들어가면 Stackdriver의 6가지 제품들을 조금 자세히 공부해야 합니다. Monitoring, Debugger, Error Reporting, Logging, Profiler, Trace가 있습니다. 위의 문제는 Monitoring을 사용한 경우입니다. 

그래서 암튼 정답은 B!!!! 

Comments