L'outil de recommandation de haute disponibilité de Cloud SQL génère de manière proactive des recommandations qui vous aident à faire en sorte que vos instances importantes respectent le contrat de niveau de service en fournissant une redondance des données. Cela peut être utile en cas de panne de zone ou lorsqu'une instance manque de mémoire.
Cette page décrit l'outil de recommandation Cloud SQL pour activer la haute disponibilité, son fonctionnement et son utilisation.
Fonctionnement
L'outil de recommandation de haute disponibilité Cloud SQL analyse les métadonnées de l'instance. Si l'instance est configurée de manière similaire aux instances qui acceptent des charges de travail importantes, mais pour lesquelles la haute disponibilité n'est pas activée, Cloud SQL vous recommande d'activer la haute disponibilité pour un contrat de niveau de service garantissant une disponibilité de 99,95 %.
Tarifs
L'outil de recommandation Cloud SQL qui active la haute disponibilité est disponible sans frais pour tous les clients Google Cloud .
Pour en savoir plus, consultez la section Tarifs des outils de recommandation.
Avant de commencer
Afin de pouvoir afficher les recommandations et les insights, procédez comme suit :
Pour obtenir les autorisations permettant d'afficher et d'utiliser les insights et les recommandations, assurez-vous de disposer des rôles IAM (Identity and Access Management) requis.
Tasks
Rôles
Afficher les recommandations
L'un des rôles suivants : recommender.cloudsqlViewer ou cloudsql.viewer.
Appliquer les recommandations
L'un des rôles suivants : recommender.cloudsqlAdmin, cloudsql.editor ou cloudsql.admin.
Dans la fiche Améliorer la fiabilité sur les instances Cloud SQL, cliquez sur Tout afficher.
gcloud
Pour répertorier les recommandations d'activation de la haute disponibilité à l'aide de gcloud CLI, exécutez la commande gcloud recommender recommendations list comme suit :
LOCATION : région où se trouvent vos instances, par exemple us-central1.
API
Pour répertorier les recommandations d'activation de la haute disponibilité à l'aide de l'API Recommendations, appelez la méthode recommendations.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.ReliabilityRecommender/recommendations
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : région où se trouvent vos instances, par exemple us-central1.
Afficher les insights et les recommandations détaillées
Console
Pour afficher des insights et des recommandations détaillées sur les instances configurées comme des instances compatibles avec les charges de travail importantes, mais pour lesquelles la haute disponibilité n'est pas activée, cliquez sur le lien de recommandation dans la liste des instances.
gcloud
Pour afficher des insights et des recommandations détaillées sur les instances configurées comme des instances compatibles avec les charges de travail importantes, mais pour lesquelles la haute disponibilité n'est pas activée, exécutez la commande gcloud recommender insights list comme suit :
LOCATION : région où se trouvent vos instances, par exemple us-central1.
API
Pour afficher des insights et des recommandations détaillées sur les instances configurées comme pour les instances acceptant des charges de travail importantes, mais pour lesquelles la haute disponibilité n'est pas activée, à l'aide de l'API Recommendations, appelez insights.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.ReliabilityInsight/insights
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : région où se trouvent vos instances, par exemple us-central1.
Le tableau suivant répertorie les insights et les recommandations générés par l'outil de recommandation d'activation de la haute disponibilité Cloud SQL. Les sous-types sont visibles dans les résultats de la CLI gcloud et de l'API.
Insight
Recommandation
Cette instance n'offre pas une haute disponibilité, même si elle est configurée de la même manière que les instances qui acceptent des charges de travail importantes. Les instances à zone unique sont plus susceptibles de subir des temps d'arrêt. Sous-typeCRITICAL_INSTANCE_HIGH_AVAILABILITY_NOT_ENABLED :
Activez la haute disponibilité pour un contrat de niveau de service garantissant une disponibilité de 99,95 %. Si vous activez la haute disponibilité, votre instance sera multizones. Cela permet de répliquer vos données dans une région pour vous protéger contre les pannes zonales, limiter le temps d'arrêt et améliorer le temps de récupération. Sous-type : ENABLE_HIGH_AVAILABILITY.
Appliquer la recommandation
Étudiez attentivement la recommandation et effectuez l'une des opérations suivantes :
Pour examiner la recommandation, cliquez sur Afficher l'instance et effectuez l'une des opérations suivantes :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/09 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/09 (UTC)."],[],[],null,["# Improve instance reliability by enabling high availability\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/recommender-enable-ha \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/recommender-enable-ha \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThe Cloud SQL enable-high-availability [recommender](/recommender/docs/overview)\nproactively generates recommendations that help you bring your important\ninstances within SLA by providing data redundancy. This might\nbe helpful during a zonal outage or when an instance runs out of memory.\n\nThis page describes the Cloud SQL enable-high-availability recommender, how this\nrecommender works, and how to use it.\n\nHow it works\n------------\n\nThe Cloud SQL enable-high-availability recommender analyzes the instance metadata. If the instance\nis configured similar to instances that support important workloads but doesn't\nhave high availability enabled, then Cloud SQL recommends that you enable high\navailability for 99.95% availability SLA.\n| **Note:** Recommendations are generated daily.\n\nPricing\n-------\n\nThe Cloud SQL enable-high-availability recommender\nis available free of cost to all Google Cloud customers.\nFor more information, see [Recommender pricing](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- To get the permissions to view and work with insights and recommendations, ensure that you have the required [Identity and Access Management (IAM) roles](/sql/docs/sqlserver/project-access-control#roles).\n\n For more information about IAM roles, see [IAM basic and predefined roles reference](/iam/docs/understanding-roles) and [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n-\n\n\n Enable the Recommender API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com)\n\nList enable-high-availability recommendations\n---------------------------------------------\n\n### Console\n\nTo list enable-high-availability recommendations by using the\nGoogle Cloud console, follow these steps:\n\n1. Go to the **Recommendation Hub**.\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n\n For more information, see\n [Getting started with Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n2. In the **Improve reliability on Cloud SQL instances** card, click **View all**.\n\n### gcloud\n\nTo list enable-high-availability recommendations by using gcloud CLI, run the\n[`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list)\ncommand as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.ReliabilityRecommender \\\n--filter=recommenderSubtype=ENABLE_HIGH_AVAILABILITY\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A [region](/docs/geography-and-regions) where your instances are located, such as `us-central1`.\n\n### API\n\nTo list enable-high-availability recommendations by using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`recommendations.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.recommenders.recommendations/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.ReliabilityRecommender/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nView insights and detailed recommendations\n------------------------------------------\n\n### Console\n\nTo view insights and detailed recommendations about instances that are\nconfigured similar to instances that support important workloads but\ndon't have\nhigh availability enabled, click the recommendation link in the list of\ninstances.\n\n### gcloud\n\nTo view insights and detailed recommendations about instances that are configured similar to instances that support important workloads but don't have\nhigh availability enabled, run the\n[`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list)\ncommand as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.ReliabilityInsight \\\n--filter=insightSubtype=CRITICAL_INSTANCE_HIGH_AVAILABILITY_NOT_ENABLED\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\n### API\n\nTo view insights and detailed recommendations about instances that are configured similar to instances that support important workloads but don't have\nhigh availability enabled by using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`insights.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes.insights/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.ReliabilityInsight/insights\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nThe following table lists the insight and recommendation that the Cloud SQL\nenable-high-availability recommender generates. The subtypes\nare visible in the gcloud CLI and API results.\n\nApply the recommendation\n------------------------\n\nEvaluate the recommendation carefully and do any of the following:\n\n- To examine the instance, click **View instance** and do any of the following:\n\n - Configure high\n availability on your instance. For more information, see\n [Enable and disable high availability](/sql/docs/sqlserver/configure-ha#console_1).\n\n | **Caution:** Once you start the high availability configuration on an instance, you can't stop it. This operation restarts the instance and can lead to an increase in cost and a brief downtime. It typically takes only a few minutes for the configuration and the restart operation to complete. However, if the instance has a large disk or load, then it might take up to an hour.\n - Migrate to the Cloud SQL Enterprise Plus edition. For more information, see\n [Introduction to Cloud SQL editions](/sql/docs/editions-intro).\n\n- To dismiss the recommendation, click **Dismiss**.\n\n- To close the panel without applying or dismissing the recommendation, click\n **Cancel**.\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)\n- [Blog: Maximize your Cloud ROI](https://cloud.google.com/blog/products/management-tools/active-assist-comes-to-google-cloud)\n- [Blog: Do more with less](https://cloud.google.com/blog/products/databases/reduce-cloud-sql-costs-with-optimizations-by-active-assist)\n- View all the [Google Cloud services available in locations worldwide](/about/locations)."]]