환경 장애 조치 테스트는 데이터 센터의 특정 영역의 완전한 서비스 중단을 시뮬레이션합니다. 이러한 시나리오에서는 데이터베이스의 영역 서비스 중단이 발생할 수 있습니다. 장애 조치 테스트를 실행하면 복원력이 우수한 환경에서 장애 조치를 실행하는 방식을 모니터링하고 이로 인해 DAG 및 태스크에 미치는 영향을 확인할 수 있습니다.
시작하기 전에
장애 조치 테스트를 실행하려면 Google 계정에 다음 역할 및 권한이 있어야 합니다.
composer.environments.update 권한 이 권한이 있는 역할 목록은 IAM으로 액세스 제어를 참조하세요.
Cloud Composer 3에서 환경의 클러스터는 환경의 테넌트 프로젝트에 있으며 영역 서비스 중단을 시뮬레이션할 수 없습니다.
환경이 정상인지 확인
장애 조치 테스트는 정상적인 환경에서만 테스트해야 합니다. 환경이 정상인지 확인하려면 다음 단계를 따르세요.
장애 조치에 사용할 수 있는 데이터베이스(composer.googleapis.com/environment/database/available_for_failover) 환경 측정항목이 True가 되면 환경의 데이터베이스가 다른 장애 조치에 사용할 준비가 됩니다. Cloud Monitoring에서 환경의 측정항목을 보는 방법에 관한 자세한 내용은 환경 모니터링을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-29(UTC)"],[[["\u003cp\u003eThis content pertains to Cloud Composer, specifically versions 1, 2, and 3.\u003c/p\u003e\n"],["\u003cp\u003eThe feature discussed in this document is not currently supported in Cloud Composer 3.\u003c/p\u003e\n"],["\u003cp\u003eThere is a link available to view related information for Cloud Composer 2.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/perform-failover-tests \"View this page for Cloud Composer 2\") \\| Cloud Composer 1\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes how to perform a database failover test for\n[highly resilient (Highly Available) environments](/composer/docs/composer-3/set-up-highly-resilient-environments).\n\nFailover tests for your environment simulate a complete outage of a zone in a\ndata center. In such a scenario, a zonal outage of a database might happen. By\nperforming a failover test, you can monitor how your highly resilient\nenvironment performs a failover and check how this affects your DAGs and tasks.\n\n\nBefore you begin\n\n- To perform failover tests, your Google Account must have the following roles\n and permissions:\n\n - `composer.environments.update` permission. See\n [Access control with IAM](/composer/docs/composer-3/access-control#user-account)\n for a list of roles with this permission.\n\n- In Cloud Composer 3, the environment's cluster is located in the tenant\n project of your environment and it's not possible to simulate a zonal\n outage for it.\n\nCheck that your environment is healthy\n\nMake sure to perform failover tests only on healthy environments. To check that\nyour environment is healthy:\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. In the list of environments, click the name of your environment.\n The **Environment details** page opens.\n\n3. Go to the **Monitoring** tab.\n\n4. Make sure that all health metrics are green.\n\nPerform a database failover test\n\nYou can perform a database failover test, which simulates a zonal outage, by\ntriggering it with a Google Cloud CLI command. For example, you might want to\ndo it to measure the amount of time it takes for your environment's database\nto switch to another zone.\n| **Note:** The database failover test is not intended for troubleshooting; it is not possible to fix issues with the database component of an environment with the failover test.\n\nTo perform a database failover test for your environment:\n\n1. Make sure that [your environment is healthy](#check-environment-health).\n\n2. Get the primary zone of your environment's database:\n\n gcloud composer environments fetch-database-properties \\\n \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n Replace the following:\n - `ENVIRONMENT_NAME`: the name of your Cloud Composer environment.\n - `LOCATION`: the region where the environment is located.\n\n Example: \n\n gcloud composer environments fetch-database-properties \\\n example-environment \\\n --location us-central1\n\n3. Start the database failover test:\n\n gcloud composer environments database-failover \\\n \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n Replace the following:\n - `ENVIRONMENT_NAME`: the name of your Cloud Composer environment.\n - `LOCATION`: the region where the environment is located.\n\n Example: \n\n gcloud composer environments database-failover \\\n example-environment \\\n --location us-central1\n\n4. Wait until the database failover test is finished. The process can take up\n to 3 minutes.\n\n5. Check that the primary zone of your environment's database is changed:\n\n gcloud composer environments fetch-database-properties \\\n \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n6. Check your environment's health metrics to make sure that\n [your environment is healthy](#check-environment-health).\n\n7. Your environment's database becomes ready for another failover when\n the **Database available for failover**\n (`composer.googleapis.com/environment/database/available_for_failover`)\n environment metric becomes `True`. For more information about viewing your\n environment's metrics in Cloud Monitoring, see\n [Monitor environments](/composer/docs/composer-3/monitor-environments#view-metrics).\n\nWhat's next\n\n- [Create environments](/composer/docs/composer-3/create-environments)\n- [Monitor environments](/composer/docs/composer-3/monitor-environments)\n- [Disaster recovery with environment snapshots](/composer/docs/composer-3/disaster-recovery-with-snapshots)"]]