Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Google Distributed Cloud (GDC) air-gapped vous permet de configurer des périodes de maintenance pour planifier les heures des mises à jour automatiques. Les intervalles de maintenance sont conçus pour cibler les périodes où un bref temps d'arrêt a le moins d'impact sur vos clusters de bases de données. Vous pouvez planifier des intervalles de maintenance en fonction du jour de la semaine et de l'heure, ainsi que de la durée pendant laquelle l'intervalle de maintenance est ouvert. Par exemple, vous pouvez définir un intervalle de maintenance qui commence le mardi à 3h et dure huit heures.
Vous pouvez également planifier des exclusions de maintenance, ce qui évite les interruptions de vos charges de travail pendant les périodes où, en raison de circonstances uniques, vous ne souhaitez pas autoriser l'intervalle de maintenance défini.
Créer un intervalle de maintenance
Pour créer un intervalle de maintenance pour votre cluster de bases de données, procédez comme suit :
Console
Dans le menu de navigation de la console GDC, sélectionnez Service de base de données.
Sélectionnez le cluster de base de données pour lequel vous souhaitez planifier les paramètres de maintenance.
Dans la section Maintenance, cliquez sur ModifierModifier.
Sélectionnez l'heure de début et la durée de l'intervalle de maintenance. Sélectionnez également les jours de la semaine pour lesquels appliquer l'intervalle de maintenance.
Pour appliquer une exclusion de maintenance, cliquez sur Ajouter une exclusion de maintenance.
Nommez l'exclusion et définissez la période à exclure pour votre intervalle de maintenance.
Cliquez sur Enregistrer.
gdcloud
Pour créer un intervalle de maintenance pour votre cluster de bases de données, exécutez la commande suivante :
PROJECT_ID : ID du projet dans lequel créer la stratégie de maintenance.
DAYS_OF_WEEK : liste des jours de la semaine où la maintenance peut commencer, séparés par une virgule. Les valeurs acceptées sont les jours de la semaine au format RFC-822, par exemple Mon.
START_TIME : heure de la journée, dans le fuseau horaire UTC, à laquelle la maintenance peut commencer. La valeur doit respecter le format hh:mm, par exemple 20:36.
DURATION : durée maximale de la maintenance, par exemple 2h3m.
Pour appliquer une exclusion de maintenance à votre intervalle de maintenance, exécutez la commande suivante :
PROJECT_ID : ID du projet dans lequel créer la stratégie de maintenance.
EXCLUSION_NAME : nom de la nouvelle exclusion de maintenance à ajouter.
START_TIME : date et heure de début de la nouvelle exclusion de maintenance. Les valeurs acceptées doivent suivre le format d'horodatage RFC-3339, par exemple 2006-01-02T15:04:05Z.
END_TIME : date et heure de fin de la nouvelle exclusion de maintenance. Les valeurs acceptées doivent suivre le format d'horodatage RFC-3339, par exemple 2006-01-02T15:04:05Z.
Vérifiez que la stratégie de maintenance existe et reflète la configuration souhaitée :
gdcloudmaintenancepolicieslist--projectPROJECT_ID
Pour associer la règle de maintenance à votre cluster de bases de données, exécutez la commande suivante :
POLICY_BINDING_NAME : nom de la ressource de liaison de stratégie.
PROJECT_ID : ID du projet dans lequel créer la stratégie de maintenance.
POLICY_NAME : nom de la stratégie de maintenance créée à l'étape précédente.
RESOURCE_NAME : nom de la ressource à laquelle associer le service.
Par exemple, pour un nom de cluster de base de données my-cluster, le nom de ressource pour chacun des moteurs de base de données disponibles serait le suivant :
AlloyDB Omni : DBCluster.alloydbomni.dbadmin.gdc.goog/my-cluster
POLICY_BINDING_NAME : nom de la liaison de la règle de maintenance.
PROJECT_ID : ID du projet dans lequel existe la stratégie de maintenance.
Gérer les exclusions de maintenance
Si vous avez créé une exclusion de maintenance pour votre intervalle de maintenance, vous pouvez la modifier ou la supprimer sans affecter l'intervalle de maintenance. Pour modifier ou supprimer une exclusion de maintenance, procédez comme suit :
Console
Dans le menu de navigation de la console GDC, sélectionnez Service de base de données.
Sélectionnez le cluster de base de données pour lequel vous souhaitez gérer une exclusion de maintenance.
Dans la section Maintenance, cliquez sur ModifierModifier.
Modifiez les plages de dates et les heures de début de l'exclusion. Si vous souhaitez supprimer l'exclusion, cliquez sur SupprimerSupprimer.
Cliquez sur Enregistrer pour enregistrer les modifications apportées à l'exclusion de maintenance dans la période de maintenance.
gdcloud
La CLI gdcloud ne permet que d'ajouter et de supprimer des exclusions de maintenance. Par conséquent, si vous souhaitez modifier la période ou les heures d'exclusion, vous devez supprimer l'exclusion existante et en ajouter une autre.
Pour supprimer une exclusion de maintenance, exécutez la commande suivante :
PROJECT_ID : ID du projet dans lequel existe la stratégie de maintenance.
EXCLUSION_NAME : nom de la nouvelle exclusion de maintenance à ajouter.
START_TIME : date et heure de début de la nouvelle exclusion de maintenance. Les valeurs acceptées doivent suivre le format d'horodatage RFC-3339, par exemple 2006-01-02T15:04:05Z.
END_TIME : date et heure de fin de la nouvelle exclusion de maintenance. Les valeurs acceptées doivent suivre le format d'horodatage RFC-3339, par exemple 2006-01-02T15:04:05Z.
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/04 (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/04 (UTC)."],[],[],null,["# Plan maintenance windows\n\nGoogle Distributed Cloud (GDC) air-gapped offers you the ability to configure maintenance\nwindows to schedule times for automatic updates. Maintenance windows are\ndesigned to target times where a brief downtime causes the lowest impact to your\ndatabase clusters. You can schedule maintenance windows based on day of the week\nand hour, and length in which the maintenance window is open. For example, you\ncould set a maintenance window to start at 3:00 AM on Tuesdays that spans eight\nhours.\n\nYou can also plan maintenance exclusions, which prevents disruptions to your\nworkloads during date ranges where, due to unique circumstances, you don't\nwant to allow the set maintenance window.\n\nCreate a maintenance window\n---------------------------\n\nTo create a maintenance window for your database cluster, complete the\nfollowing steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to plan maintenance settings\n for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. Select the **Start time** and **Length** for the maintenance window. Also\n select the days of the week to apply the maintenance window for.\n\n | **Important:** Due to other possible processes running when the maintenance window opens for your database cluster, automatic updates for your database cluster could have a delayed start. The maintenance window length defines when the maintenance processes can start. After maintenance on the database cluster starts, the process runs until completion, possibly running past the defined maintenance window.\n\n5. To apply a maintenance exclusion, click **Add Maintenance Exclusion**.\n\n6. Give the exclusion a name and define the time window to exclude for\n your maintenance window.\n\n7. Click **Save**.\n\n### gdcloud\n\n1. To create a maintenance window for your database cluster, run:\n\n gdcloud maintenance policies create \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --weekly-cycle-days \u003cvar translate=\"no\"\u003eDAYS_OF_WEEK\u003c/var\u003e \\\n --weekly-cycle-start-time \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --weekly-cycle-duration \u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003eDAYS_OF_WEEK\u003c/var\u003e: Comma-separated list of days of the week when maintenance can begin. Accepted values are RFC-822 formatted days of the week, such as `Mon`.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The time of the day, in UTC timezone, when maintenance can begin. The value must follow the `hh:mm` format, such as `20:36`.\n - \u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e: The maximum duration that the maintenance can last for, such as `2h3m`.\n2. To apply a maintenance exclusion to your maintenance window, run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --add-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e \\\n --add-exclusion-start \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --add-exclusion-end \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the new maintenance exclusion to add.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The start date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n - \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e: The end date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n3. Verify the maintenance policy exists and reflects your intended\n configuration:\n\n gdcloud maintenance policies list --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n4. To attach the maintenance policy to your database cluster, run:\n\n gdcloud maintenance policy-bindings create \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --policy-name \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --resource-name \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e: The name of the policy binding resource.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to create the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy created in the previous step.\n - \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e: The resource name to bind to.\n For example, for a database cluster name `my-cluster`, the resource\n name for each of the available database engines would be the following:\n\n - AlloyDB Omni: `DBCluster.alloydbomni.dbadmin.gdc.goog/my-cluster`\n - Oracle: `DBCluster.oracle.dbadmin.gdc.goog/my-cluster`\n - PostGreSQL: `DBClusters.postgresql.dbadmin.gdc.goog/my-cluster`\n5. Verify the policy binding exists, and its `Valid` condition is `True`:\n\n gdcloud maintenance policy-bindings list --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of the project in\n which to create the maintenance policy.\n\nRemove a maintenance window\n---------------------------\n\nTo remove a maintenance window for your database cluster, complete the\nfollowing steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to plan maintenance settings\n for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. In the **Length** field, select **24h**.\n\n5. Select all the days of the week.\n\n6. Click **Save**.\n\nThis removes the defined maintenance window and allows maintenance updates\nto start at any time.\n\n### gdcloud\n\n1. To remove a maintenance window from your database cluster, run:\n\n gdcloud maintenance policies delete \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n2. Remove the maintenance policy binding from the database cluster:\n\n gdcloud maintenance policy-bindings delete \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_BINDING_NAME\u003c/var\u003e: The name of the maintenance policy binding.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n\nManage maintenance exclusions\n-----------------------------\n\nIf you created a maintenance exclusion for your maintenance window, you can edit\nor remove the exclusion without affecting the maintenance window. To edit or\nremove a maintenance exclusion, complete the following steps: \n\n### Console\n\n1. From the navigation menu of the GDC console, choose **Database\n Service**.\n\n2. Select the database cluster that you want to manage a maintenance\n exclusion for.\n\n3. In the **Maintenance** section, click\n edit **Edit**.\n\n4. Edit the date ranges and start times of the exclusion. If you want to\n delete the exclusion, click\n delete **Delete**.\n\n5. Click **Save** to save your maintenance exclusion modifications to the\n maintenance window.\n\n### gdcloud\n\nThe gdcloud CLI only supports adding and deleting maintenance\nexclusions. Therefore, you must delete the existing exclusion and add a new\none if you want to modify your exclusion date range or times.\n\n1. To delete a maintenance exclusion, run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --remove-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which to delete the maintenance policy's exclusion.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the maintenance exclusion to delete.\n2. To add a new maintenance exclusion to apply any previous exclusion edits,\n run:\n\n gdcloud maintenance policies update \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e \\\n --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --add-exclusion-name \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e \\\n --add-exclusion-start \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e \\\n --add-exclusion-end \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e: The name of the maintenance policy.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project in which the maintenance policy exists.\n - \u003cvar translate=\"no\"\u003eEXCLUSION_NAME\u003c/var\u003e: The name of the new maintenance exclusion to add.\n - \u003cvar translate=\"no\"\u003eSTART_TIME\u003c/var\u003e: The start date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`.\n - \u003cvar translate=\"no\"\u003eEND_TIME\u003c/var\u003e: The end date and time for the new maintenance exclusion. Accepted values must follow the RFC-3339 formatted timestamp, such as `2006-01-02T15:04:05Z`."]]