기존 HA 구성에서 MySQL용 Cloud SQL 인스턴스는 장애 조치 복제본을 사용하여 인스턴스에 고가용성을 추가합니다.
Trusted Cloud 콘솔에서는 이 기능을 사용할 수 없습니다. 권장되는 구성은 장애 조치 복제본을 사용하지 않습니다. 대신 현재 고가용성 구성은 한 리전 내 두 영역 간에 블록 수준에서 데이터를 동기식으로 복제하는 Google 리전 영구 디스크를 사용합니다.
Trusted Cloud 콘솔의 탐색 패널에서 Monitoring을 선택한 후 알림을 선택합니다.
알림 정책 만들기를 클릭합니다.
알림을 설명하는 이름을 입력합니다.
측정항목 기준을 선택하고 다음을 클릭하여 대상 탭을 엽니다.
리소스 유형에서 Cloud SQL을 선택합니다.
적용 대상에서 단일을 선택한 다음 장애 조치 복제본을 선택합니다.
다음을 클릭하여 구성 탭을 엽니다.
다음 값을 입력합니다.
필드
값
측정항목 조건
마스터보다 뒤처진 시간(초)
조건
위쪽
기준
120(또는 사용자 환경에 적합한 값)
기간
3분
알림 방법을 선택하고 조건 저장을 클릭합니다.
기존 구성: 장애 조치 복제본 그룹에 알림 설정
같은 프로젝트에 장애 조치 복제본을 여러 개 만들려면 각 장애 조치 복제본이 아닌 전체 그룹에 알림을 설정하는 것이 더 간편할 수 있습니다. 모니터링할 그룹을 만들려면 장애 조치 복제본 이름에 '-failover'와 같은 접미사를 사용합니다. 다른 유형의 Cloud SQL 인스턴스에는 이 서픽스를 사용하지 마세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-14(UTC)"],[],[],null,["# Legacy configuration for high availability\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n| **Important:** As of January 13, 2025, the legacy configuration for high availability (HA) is deprecated for all instances. You can't create instances with legacy high availability configuration, and you can't enable legacy high availability configuration on any existing instances. In addition, after January 13, 2025, legacy high availability instances are no longer covered by the [Cloud SQL SLA](/sql/sla). \n|\n| We recommend that you update your remaining legacy high availability instances to the current high availability configuration. You can do so by following the instructions in [Update an instance from legacy to current high availability](/sql/docs/mysql/configure-legacy-ha#update-from-legacy). Starting on May 1, 2025, Cloud SQL will begin updating any instances that use the legacy high availability configuration to use the current regional persistent disk-based high availability configuration automatically.\n\n\u003cbr /\u003e\n\nThis page describes the legacy configuration for a MySQL instance for high availability (HA).\n\nIn a legacy HA configuration,\na Cloud SQL for MySQL instance uses a failover replica to add high availability to the instance.\nThis feature isn't available in Google Cloud console. The recommended configuration doesn't use\nfailover replicas. Instead, the current high availability configuration uses Google\n[regional persistent disks](/compute/docs/disks#repds), which synchronously\nreplicate data at the block-level between two zones in a region.\n\nFor more information about the current high availability configuration, see\n[Overview of the High Availability Configuration](/sql/docs/mysql/high-availability).\n\nUpdate an instance from legacy to current high availability\n-----------------------------------------------------------\n\nTo update your instance from the legacy to the current high availability\nconfiguration, do the following:\n\n1. Update your instance to the current high availability configuration.\n\n 1. Delete the failover replica for the MySQL instance you want to update. For more information, see [Disable high availability on an instance](#disable-ha-legacy).\n 2. Configure the primary instance to use the current version of high availability. For more information, see [Configure an existing instance for high availability](/sql/docs/mysql/configure-ha#ha-existing).\n\n As another option, use Database Migration Service to [migrate to an instance](/database-migration/docs/mysql/create-migration-job#dest)\n that uses the current high availability configuration.\n2. [Create a read replica instance](/sql/docs/mysql/replication/create-replica#create-2nd-gen)\n to offload any read workloads that you don't want to perform on the primary instance.\n\nInitiate failover\n-----------------\n\nTesting failover is optional, but is recommended so that you can see how your\napplication responds in the event of a failover.\n| **Note:** This feature helps you test your application's response to an automatic failover. Make sure your instance has completed any previous failover (so it is responding to connection requests) before you trigger another failover.\n\nTo learn more about failovers, see the\n[Failover overview](/sql/docs/mysql/high-availability#failover-overview). \n\n### gcloud\n\nInitiate the failover: \n\n```bash\ngcloud sql instances failover PRIMARY_INSTANCE_NAME\n```\n\n### curl\n\n1. Describe the primary instance to get the value of the `settingsVersion` field. \n\n ```bash\n gcloud auth login\n ACCESS_TOKEN=\"$(gcloud auth print-access-token)\"\n curl --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -X GET \\\n https://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/PRIMARY_INSTANCE_NAME\n ```\n2. Initiate the failover: \n\n ```bash\n gcloud auth login\n ACCESS_TOKEN=\"$(gcloud auth print-access-token)\"\n curl --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header 'Content-Type: application/json' \\\n --data '{\"failoverContext\":{\"settingsVersion\":\"\u003cvar translate=\"no\"\u003eSETTINGS_VERSION\u003c/var\u003e\"}}' \\\n -X POST \\\n https://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/PRIMARY_INSTANCE_NAME/failover\n ```\n\nThe instance fails over and is not available to serve data for a few minutes.\n\nLegacy configuration: Create an alert for replication lag\n---------------------------------------------------------\n\nThe time required for a failover operation depends on the amount of replication\nlag when the failover is initiated. You can use Cloud Monitoring in the\nGoogle Cloud console to alert you when replication lag exceeds a threshold.\n| **Note:** Failover downtime caused by replication lag greater than 1200 seconds is not counted against the SLA for the instance.\n\nFor more information about replication lag, search for \"seconds_behind_master\"\non the\n[SHOW SLAVE STATUS Syntax](https://dev.mysql.com/doc/refman/8.0/en/show-slave-status.html)\npage in the MySQL documentation.\n\nFor more information about Cloud Monitoring, see\n[the Cloud Monitoring documentation](/monitoring/docs).\n| **Note:** A newly created Cloud SQL instance can take time to appear in the Cloud Monitoring interface. If you don't see a new instance, then check again in an hour.\n\n### Legacy configuration: Set an alert for a specific failover replica\n\n1. In the navigation panel of the Google Cloud console, select **Monitoring** , and then select **Alerting**.\n2. Click **Create Alerting Policy**.\n3. Enter a descriptive name for your alert.\n4. Select **Metric Threshold** and click **Next** to open the Target tab.\n5. For **Resource Type** , select **Cloud SQL**.\n6. For **Applies To** , select **Single**, then select your failover replica.\n7. Click **Next** to open the Configuration tab.\n8. Enter the following values:\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n9. Select your **Notification** methods, and click **Save Condition**.\n\n### Legacy configuration: Set an alert for a group of failover replicas\n\nIf you plan to create multiple failover replicas in the same project, it could\nbe easier to set the alert for the entire group, rather than on each failover\nreplica individually. To create a group for monitoring, use a suffix for the\nfailover replicas' names, such as \"-failover\". Make sure you don't use this\nsuffix for any other types of Cloud SQL instances.\n\n**Create your failover replica group:**\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. From the upper menu bar, select **Groups** \\\u003e **Create...**.\n3. Enter a descriptive name for your group.\n4. Leave **Name** and **Contains** selected, and enter your name substring.\n5. Click **Save Group**. The summary page for the new group opens.\n6. Confirm that the expected instances are included in the group.\n\n| **Note:** If you open the **Groups Overview** page, where all existing groups are listed, then your group shows 0 instances. This is because Cloud Monitoring uses the term \"instances\" to mean VMs and VM clusters. Cloud SQL instances are shown under *Resources*.\n\n**Create the alert for the failover replica group:**\n\n1. In the navigation panel of the Google Cloud console, select **Monitoring** , and then select **Alerting**.\n2. Click **Create Alerting Policy**.\n3. Enter a descriptive name for your group alert.\n4. Select **Metric Threshold** and click **Next** to open the Target tab.\n5. For **Resource Type** , select **Cloud SQL**.\n6. For **Applies To** , select **Group**, then select your failover group.\n7. Leave **Any Member Violates** selected and click **Next** to open the Configuration tab.\n8. Enter the following values:\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n9. Select your desired **Notification** methods, and click **Save Condition**.\n\n### Legacy configuration: Disable high availability on an instance\n\nYou need to delete the failover replica instance to remove high availability from the\nprimary instance.\n\nBefore you perform this procedure, make sure there are no operations currently\nrunning on the primary instance.\n\nTo disable high availability: \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. Select the failover instance associated with the instance you want to disable high availability on.\n3. On the **Instance details** page, click **Delete**.\n4. In the **Delete Replica** window, retype the name of failover instance.\n5. Click **Delete**. The configuration for the original instance changes to zonal.\n\n### gcloud\n\nFor reference information, see [gcloud sql instances delete](/sdk/gcloud/reference/sql/instances/delete). \n\n```bash\ngcloud sql instances delete FAILOVER_REPLICA_NAME\n```\n\n### curl\n\nThe following request uses the [instances:delete](/sql/docs/mysql/admin-api/rest/v1beta4/instances/delete) method to delete the instance. \n\n```bash\ngcloud auth login\nACCESS_TOKEN=\"$(gcloud auth print-access-token)\"\ncurl --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header 'Content-Type: application/json'\\\n -X DELETE\\\nhttps://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/INSTANCE_NAME\n```\n\nWhat's next\n-----------\n\n- Learn more about [how the high availability configuration works](/sql/docs/mysql/high-availability).\n- Test how your application responds to lost connections by [restarting your instance](/sql/docs/mysql/start-stop-restart-instance).\n- Learn more about [managing your database connections](/sql/faq#connections).\n- Learn more about [Cloud Monitoring](/monitoring/docs).\n- [Create read replicas](/sql/docs/mysql/replication) for your instance."]]