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.
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.
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With