如何在 Google Composer 上重启气流服务器?
How can I restart the airflow server on Google Composer?
当我需要在本地重启网络服务器时,我会这样做:
ps -ef | grep airflow | awk '{print }' | xargs kill -9
airflow webserver -p 8080 -D
如何在 Google Composer 上执行此操作?我在控制台中没有看到重启服务器的选项。
由于 Cloud Composer 是 Apache Airflow managed service, it is not possible to restart the whole service. You can restart though the single instances of the service, as described here,但这无助于应用插件更改。
要应用插件更改,您应该 install the plugin 将其加载到 plugin
文件夹中,该文件夹在您创建环境时自动创建:
gcloud composer environments storage plugins import --environment ENVIRONMENT_NAME \
--location LOCATION \
--source PATH_TO_LOCAL_FILE \
--destination PATH_IN_SUBFOLDER
DAG 更新是自动执行的,其他一些必须使用
应用
gcloud composer environments update
重启 Composer 服务器的一种方法是在 GCP Composer UI 的 'Environment Variables' 中添加一个 'dummy variable'。提交后,它将重新启动以包含此更改。
编辑:仅适用于 1.13.1 >= Composer 版本 < 2.0.0
重新启动 Airflow 最近作为一项功能引入了预览 here。
TL;DR 命令是:
gcloud beta composer environments restart-web-server ENVIRONMENT_NAME
--location=LOCATION
当我需要在本地重启网络服务器时,我会这样做:
ps -ef | grep airflow | awk '{print }' | xargs kill -9
airflow webserver -p 8080 -D
如何在 Google Composer 上执行此操作?我在控制台中没有看到重启服务器的选项。
由于 Cloud Composer 是 Apache Airflow managed service, it is not possible to restart the whole service. You can restart though the single instances of the service, as described here,但这无助于应用插件更改。
要应用插件更改,您应该 install the plugin 将其加载到 plugin
文件夹中,该文件夹在您创建环境时自动创建:
gcloud composer environments storage plugins import --environment ENVIRONMENT_NAME \
--location LOCATION \
--source PATH_TO_LOCAL_FILE \
--destination PATH_IN_SUBFOLDER
DAG 更新是自动执行的,其他一些必须使用
应用gcloud composer environments update
重启 Composer 服务器的一种方法是在 GCP Composer UI 的 'Environment Variables' 中添加一个 'dummy variable'。提交后,它将重新启动以包含此更改。
编辑:仅适用于 1.13.1 >= Composer 版本 < 2.0.0
重新启动 Airflow 最近作为一项功能引入了预览 here。
TL;DR 命令是:
gcloud beta composer environments restart-web-server ENVIRONMENT_NAME
--location=LOCATION