클라우드/GCP(26)
-
GCP 모니터링 뷰어 IAM 권한 주기
iam 에게 monitoring viewer 및 대시보드를 편집할 수 있는 권한과 log 데이터를 볼 수 있는 권한을 주려 한다. 1) Cloud Logging 관련 역할 Logs Viewer : 로그 데이터 보기 2) Cloud Monitoring 관련 역할 Monitoring Viewer : 모니터링 대시보드 보기 권한 Monitoring Dashboard Configuration Editor : Monitoring 대시보드를 생성/편집 IAM > GRANT ACCESS > 사용자 계정 입력 > Logs Viewer, Monitoring Viewer, Monitoring Dashboard Configuration Editor 선택role에서 입력할 때 대소문자를 구분하기 때문에 입력했을 때 안나..
2025.01.17 -
23. dag 작업 결과 slack 알림
gcp에서 dag 작업 결과를 slack으로 받고 싶다면? 필요한 dag 내용은 다음과 같다.from airflow import DAGimport requests # Slack 알림에 사용# Slack 알림 함수def send_slack_alert(context, status): webhook_url = "https://hooks.slack.com/xxxx" task_instance = context.get('task_instance') dag_id = context.get('dag').dag_id task_id = context.get('task').task_id execution_date = context.get('execution_date') log_url = c..
2024.12.05 -
22. Migrate to Cloud SQL for PostgreSQL using Database Migration Service
Task 1. Prepare the source database for migration sudo apt install postgresql-13-pglogical sudo su - postgres -c "gsutil cp gs://cloud-training/gsp918/pg_hba_append.conf ."sudo su - postgres -c "gsutil cp gs://cloud-training/gsp918/postgresql_append.conf ."sudo su - postgres -c "cat pg_hba_append.conf >> /etc/postgresql/13/main/pg_hba.conf"sudo su - postgres -c "cat postgresql_append.conf >> /et..
2024.12.04 -
21. Create and Manage AlloyDB Instances: Challenge Lab
Task 1. Create a cluster and instancegcloud beta alloydb clusters create lab-cluster \ --password=Change3Me \ --network=peering-network \ --region=us-central1 \ --project=qwiklabs-gcp-00-9180b9934581cluster 생성 된 것 확인 gcloud beta alloydb instances create lab-instance \ --instance-type=PRIMARY \ --cpu-count=2 \ --region=us-central1 \ --cluster=lab-cluster \ --project=..
2024.12.03 -
20. Accelerating Analytical Queries using the AlloyDB Columnar Engine
Task 1. Create Baseline Dataset for Testing the Columnar Engine export ALLOYDB=ALLOYDB_ADDRESSecho $ALLOYDB > alloydbip.txt pgbench -h $ALLOYDB -U postgres -i -s 500 -F 90 -n postgres psql -h $ALLOYDB -U postgresselect count (*) from pgbench_accounts; Task 2. Run a Baseline Test\timing on SELECT aid, bid, abalance FROM pgbench_accounts WHERE bid OR abalance > 100 LIMIT 20; EXPLAIN (ANALY..
2024.12.02 -
19. Administering an AlloyDB Database
Task 1. Examine a Database Flag데이터베이스 플래그 검사클릭 1.To add a database flag to your instance, expand Advanced Configuration Options and click on Add a Database Flag. 2.Browse the list of avaiable flags (inside Choose a flag) to get a sense of the supported options. You will not add an additional flag as part of this lab.3.Click Cancel twice to exit the Edit Primary instance screen. Task 2. Setup a D..
2024.11.27