Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I restart the airflow server on Google Composer?

When I need to restart the webserver locally I do:

ps -ef | grep airflow | awk '{print $2}' | xargs kill -9
airflow webserver -p 8080 -D

How can I do this on Google Composer? I don't see an option to restart the server in the console.

like image 610
howMuchCheeseIsTooMuchCheese Avatar asked Jul 17 '18 14:07

howMuchCheeseIsTooMuchCheese


People also ask

How do I reset the composer environment?

You cannot stop/restart a cloud composer environment. And till date the metadata DB is associated with the composer environment, hence deleting this environment would delete everything associated with that task.

How do you run Airflow in GCP?

Airflow runs on port 8080, and in GCP we need to whitelist the IP for this port. Navigate to the VPC Network > Click on Firewall and create a port rule. Add port 8080 under TCP and click Create Rule in the Port rule. On the Compute Instance, add the Firewall rule to access port 8080.

Is Airflow and composer same?

Cloud Composer is built on the popular Apache Airflow open source project and operates using the Python programming language. By using Cloud Composer instead of a local instance of Apache Airflow, you can benefit from the best of Airflow with no installation or management overhead.

How do I change the Airflow CFG in composer?

Go to the Airflow configuration overrides tab. Click Edit. Enter the Section, Key, and Value for the Airflow configuration option that you want to change.


2 Answers

A way to restart Composer server is to add a 'dummy variable' into the 'Environment Variables' of GCP Composer UI. After submitting, it will restart to include this change. enter image description here

like image 53
Romain Avatar answered Sep 19 '22 20:09

Romain


EDIT: Only works for 1.13.1 >= Composer version < 2.0.0

Restarting the Airflow has recently been introduced as a feature in preview here.

TL;DR the command is:

gcloud beta composer environments restart-web-server ENVIRONMENT_NAME
  --location=LOCATION
like image 30
GregK Avatar answered Sep 16 '22 20:09

GregK