Am 15. September 2026erreichen alle Cloud Composer 1- und Cloud Composer 2-Umgebungen der Version 2.0.x das geplante Ende des Lebenszyklus und können nicht mehr verwendet werden. Wir empfehlen, die Migration zu Cloud Composer 3 zu planen.
Auf dieser Seite wird beschrieben, wie eine Umgebung aktualisiert werden kann.
Aktualisierungsvorgänge
Wenn Sie Parameter Ihrer Umgebung ändern, z. B. neue Skalierungs- und Leistungsparameter angeben oder benutzerdefinierte PyPI-Pakete installieren, wird Ihre Umgebung aktualisiert.
Nach Abschluss dieses Vorgangs sind die Änderungen in Ihrer Umgebung verfügbar.
Für eine einzelne Cloud Composer-Umgebung kann jeweils nur ein Aktualisierungsvorgang gestartet werden. Sie müssen warten, bis ein Aktualisierungsvorgang abgeschlossen ist, bevor Sie einen weiteren Umgebungsvorgang starten.
Auswirkungen von Updates auf laufende Airflow-Tasks
Wenn Sie ein Update ausführen, müssen Airflow-Planer und ‑Worker in Ihrer Umgebung möglicherweise neu gestartet werden. In diesem Fall werden alle aktuell laufenden Aufgaben beendet. Nach Abschluss des Aktualisierungsvorgangs plant Airflow diese Aufgaben für einen Wiederholungsversuch ein, je nachdem, wie Sie Wiederholungsversuche für Ihre DAGs konfigurieren.
Die folgenden Änderungen führen zum Beenden von Airflow-Aufgaben:
Upgrade Ihrer Umgebung auf eine neue Version
Benutzerdefinierte PyPI-Pakete werden hinzugefügt, geändert oder gelöscht.
Cloud Composer-Umgebungsvariablen ändern.
Hinzufügen oder Entfernen von Überschreibungen von Airflow-Konfigurationsoptionen oder Ändern ihrer Werte.
Ändern der CPU, des Arbeitsspeichers oder des Speichers von Airflow-Workern.
Die maximale Anzahl von Airflow-Workern wird reduziert, wenn der neue Wert niedriger als die Anzahl der aktuell ausgeführten Worker ist. Wenn in einer Umgebung beispielsweise derzeit drei Worker ausgeführt werden und das Maximum auf zwei reduziert wird,
Die folgenden Änderungen führen nicht zum Beenden von Airflow-Aufgaben:
Erstellen, Aktualisieren oder Löschen einer DAG (kein Aktualisierungsvorgang).
DAGs pausieren oder die Pausierung aufheben (kein Updatevorgang).
Aktivieren oder Deaktivieren der Einbindung von Dataplex Universal Catalog Data Lineage.
Umgebungsgröße ändern
Ändern der Anzahl der Planer.
Ändern der CPU, des Arbeitsspeichers oder des Speichers von Airflow-Planern.
Die Anzahl der Trigger ändern.
Ändern der CPU, des Arbeitsspeichers oder des Speichers von Airflow-Triggern.
Ändern der CPU, des Arbeitsspeichers oder des Speichers des Airflow-Webservers.
Erhöhen oder verringern Sie die Mindestanzahl von Workern.
Reduzieren Sie die maximale Anzahl von Airflow-Workern. Wenn in einer Umgebung beispielsweise derzeit zwei Worker ausgeführt werden und das Maximum auf drei reduziert wird.
Wartungsfenster ändern
Einstellungen für geplante Snapshots ändern
Umgebungslabels ändern
Mit Terraform aktualisieren
Führen Sie terraform plan vor terraform apply aus, um zu prüfen, ob Terraform eine neue Umgebung erstellt, anstatt die vorhandene zu aktualisieren.
Hinweise
Prüfen Sie, ob Ihr Konto, das Dienstkonto Ihrer Umgebung und das Cloud Composer-Dienst-Agent-Konto in Ihrem Projekt die erforderlichen Berechtigungen haben:
Der Befehl gcloud composer environments update wird beendet, wenn der Vorgang abgeschlossen ist. Mit dem Flag --async können Sie vermeiden, dass Sie warten müssen, bis der Vorgang abgeschlossen ist.
Umgebungen aktualisieren
Weitere Informationen zum Aktualisieren Ihrer Umgebung finden Sie auf anderen Dokumentationsseiten zu bestimmten Aktualisierungsvorgängen. Beispiel:
RESOURCE_NAME durch den Namen der Ressourcen Ihrer Umgebung.
Änderungen an Updates rückgängig machen
In seltenen Fällen kann ein Updatevorgang unterbrochen werden (z. B. aufgrund eines Timeouts). Die angeforderten Änderungen werden dann möglicherweise nicht in allen Umgebungskomponenten (z. B. dem Airflow-Webserver) rückgängig gemacht.
Bei einem Updatevorgang werden beispielsweise zusätzliche PyPI-Module installiert oder entfernt, eine neue Airflow- oder Cloud Composer-Umgebungsvariable wird neu definiert oder definiert oder einige Airflow-bezogene Parameter werden geändert.
Eine solche Situation kann auftreten, wenn ein Aktualisierungsvorgang ausgelöst wird, während andere Vorgänge laufen, z. B. die automatische Skalierung eines Cloud Composer-Clusters oder ein Wartungsvorgang.
In diesem Fall empfiehlt es sich, den Vorgang zu wiederholen.
Dauer von Aktualisierungs- oder Upgradevorgängen
Die Dauer von Update- und Upgradevorgängen wird von den folgenden Faktoren beeinflusst:
Für die meisten Aktualisierungs- oder Upgradevorgänge müssen Airflow-Komponenten wie Airflow-Planer, -Worker und -Webserver neu gestartet werden. Nach dem Neustart einer Komponente muss sie initialisiert werden. Während der Initialisierung laden Airflow-Planer und -Worker die Inhalte der Ordner /dags und /plugins aus dem Bucket der Umgebung herunter. Das Synchronisieren von Dateien mit Airflow-Planern und ‑Workern erfolgt nicht sofort, sondern hängt von der Gesamtgröße und Anzahl aller Objekte in diesen Ordnern ab.
Wir empfehlen, nur DAG- und Plug-in-Dateien in den Ordnern /dags bzw. /plugins zu behalten und alle anderen Dateien zu entfernen. Zu viele Daten in den Ordnern /dags und /plugins können die Initialisierung von Airflow-Komponenten verlangsamen und in bestimmten Fällen unmöglich machen.
Wir empfehlen, weniger als 30 MB Daten in den Ordnern /dags und /plugins zu speichern und die Datengröße von 100 MB auf keinen Fall zu überschreiten. Weitere Informationen finden Sie auch unter Große Anzahl von DAGs und Plug-ins verarbeiten.
Die Größe der Airflow-Datenbank kann die Dauer von Upgrade-Vorgängen erheblich verlängern. Wir empfehlen, die Größe der Airflow-Datenbank durch Konfigurieren einer Datenbankaufbewahrungsrichtlinie zu verwalten.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-29 (UTC)."],[[["\u003cp\u003eThis page describes how to update Cloud Composer environments, noting that it currently reflects Cloud Composer 2 documentation.\u003c/p\u003e\n"],["\u003cp\u003eUpdating an environment can involve changes to parameters like scaling, performance, or custom PyPI packages, with only one update operation allowed at a time.\u003c/p\u003e\n"],["\u003cp\u003eCertain updates, such as upgrading the environment or modifying custom packages and configurations, will terminate all running Airflow tasks, while others like changes to DAGs or connections will not.\u003c/p\u003e\n"],["\u003cp\u003eUpdating with Terraform may result in the deletion and recreation of the environment if the parameter being changed is not supported for updates, and caution is advised.\u003c/p\u003e\n"],["\u003cp\u003eUpdate operations can be affected by the size of data in \u003ccode\u003e/dags\u003c/code\u003e and \u003ccode\u003e/plugins\u003c/code\u003e folders, and keeping it below 30MB, and never above 100 MB, is highly recommended to prevent slowdowns or initialization failures.\u003c/p\u003e\n"]]],[],null,["# Update Cloud Composer environments\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/update-environments \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/update-environments \"View this page for 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 explains how an environment can be updated.\n\nAbout update operations\n-----------------------\n\nWhen you change parameters of your environment, such as specifying new scaling\nand performance parameters, or installing custom PyPI packages, your\nenvironment updates.\n\nAfter this operation is completed, changes become available in your\nenvironment.\n\nFor a single Cloud Composer environment, you can start only one\nupdate operation at a time. You must wait for an update operation to complete\nbefore starting another environment operation.\n\nHow updates affect running Airflow tasks\n----------------------------------------\n\n| **Caution:** Some update operations **terminate all running tasks**.\n\nWhen you [run an update operation](#update-operations), Airflow schedulers and\nworkers in your environment might require a restart. In this case, all\ncurrently running tasks are terminated. After the update operation is\ncompleted, Airflow schedules these tasks for a retry, depending on the way you\nconfigure retries for your DAGs.\n| **Note:** Airflow workers can get restarted as part of the environment maintenance, during the maintenance windows.\n\nThe following changes **cause** Airflow task termination:\n\n- Upgrading your environment to a new version.\n- Adding, changing, or deleting custom PyPI packages.\n- Changing Cloud Composer environment variables.\n- Adding or removing Airflow configuration options overrides, or changing their values.\n- Changing Airflow workers' CPU, memory, or storage.\n- Reducing the maximum number of Airflow workers, if the new value is\n lower than the number of currently running workers. For example, if an\n environment currently runs three workers, and the maximum is reduced to two.\n\nThe following changes **don't cause** Airflow task termination:\n\n- Creating, updating, or deleting a DAG (not an update operation).\n- Pausing or unpausing DAGs (not an update operation).\n- Changing Airflow variables (not an update operation).\n- Changing Airflow connections (not an update operation).\n- Enabling or disabling Dataplex Universal Catalog Data Lineage integration.\n- Changing environment's size.\n- Changing the number of schedulers.\n- Changing Airflow schedulers' CPU, memory, or storage.\n- Changing the number of triggerers.\n- Changing Airflow triggerers' CPU, memory, or storage.\n- Changing Airflow web server's CPU, memory, or storage.\n- Increasing or decreasing the minimum number of workers.\n- Reducing the maximum number of Airflow workers. For example, if an environment currently runs two workers, and the maximum is reduced to three.\n- Changing maintenance windows.\n- Changing scheduled snapshots settings.\n- Changing environment labels.\n\nUpdating with Terraform\n-----------------------\n\n| **Warning:** If you attempt to change a configuration parameter that cannot be updated, Terraform **deletes your environment and creates a new one** with the new parameter value.\n\nRun `terraform plan` before `terraform apply` to see if Terraform creates a new\nenvironment instead of updating it.\n\nBefore you begin\n----------------\n\n- Check that your account, the service account of your environment, and\n the Cloud Composer Service Agent account in your project have\n required permissions:\n\n - Your account must have a role that\n [can trigger environment update operations](/composer/docs/composer-3/access-control#user-account).\n\n - The service account of your environment must have a role that\n [has enough permissions to perform update operations](/composer/docs/composer-3/access-control#service-account).\n\n- The `gcloud composer environments update` command terminates when the\n operation is finished. You can use the `--async` flag to avoid waiting for\n the operation to complete.\n\nUpdate environments\n-------------------\n\nFor more information about updating your environment, see other documentation\npages about specific update operations. For example:\n\n- [Override Airflow configuration options](/composer/docs/composer-3/override-airflow-configurations)\n- [Set environment variables](/composer/docs/composer-3/set-environment-variables)\n- [Install Python dependencies](/composer/docs/composer-3/install-python-dependencies)\n- [Scale environments](/composer/docs/composer-3/scale-environments)\n\nView environment details\n------------------------\n\n### Console\n\n1. In 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\n### gcloud\n\nRun the following `gcloud` command: \n\n gcloud composer environments describe \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\nReplace:\n\n- `ENVIRONMENT_NAME` with the name of the environment.\n- `LOCATION` with the region where the environment is located.\n\n### API\n\nConstruct an [`environments.get`](/composer/docs/reference/rest/v1/projects.locations.environments/get) API request.\n\nExample: \n\n GET https://composer.googleapis.com/v1/projects/example-project/\n locations/us-central1/environments/example-environment\n\n### Terraform\n\nRun the `terraform state show` command for your environment's resource.\n\nThe name of your environment's Terraform resource might be different than the\nname of your environment. \n\n terraform state show google_composer_environment.\u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e\n\nReplace:\n\n- `RESOURCE_NAME` with the name of your environment's resource.\n\n### Rolling back update changes\n\nIn some rare situations, an update operation might be interrupted\n(for example, because of a timeout) and the requested changes might not be\nrolled back in all environment components (such as the Airflow web server).\n\nFor example, an update operation might be installing or removing additional\nPyPI modules, re-defining or defining a new Airflow or Cloud Composer\nenvironment variable, or changing some Airflow-related parameters.\n\nSuch a situation might occur if an update operation is triggered when other\noperations are in progress, for example Cloud Composer cluster's\nautoscaling or a maintenance operation.\n\nIn such a situation, it's recommended to repeat the operation.\n\n### Duration of update or upgrade operations\n\nThe duration of update and upgrade operations is affected by the following\nfactors:\n\n- Most update or upgrade operations require restarting Airflow components\n like Airflow schedulers, workers and web servers. After a component is\n restarted, it must be initialized. During the initialization, Airflow\n schedulers and workers download the contents of `/dags` and `/plugins`\n folders from the environment's bucket. The process of syncing files to\n Airflow schedulers and workers isn't instantaneous and depends on the total\n size and number of all objects in these folders.\n\n We recommend to keep only DAG and plugin files in `/dags` and `/plugins`\n folders (respectively) and remove all other files. Too much data\n in `/dags` and `/plugins` folders might slow down the initialization of\n Airflow components and in certain cases might make the initialization not\n possible.\n\n We recommend to keep less than 30 MB of data in `/dags` and `/plugins`\n folders, and to definitely not exceed 100 MB size of data. For more\n information, also see\n [Handling large number of DAGs and plugins](/composer/docs/composer-2/troubleshooting-dags#large-number-of-dags)\n- The size of the Airflow database might significantly increase the time of\n upgrade operations. We recommend to maintain the Airflow database size by\n\n configuring a [database retention policy](/composer/docs/composer-3/configure-db-retention).\n\nWhat's next\n-----------\n\n- [Upgrade environments](/composer/docs/composer-3/upgrade-environments)\n- [Override Airflow configuration options](/composer/docs/composer-3/override-airflow-configurations)"]]