Google Cloud Composer and Google Cloud SQL Proxy

江枫思渺然 提交于 2019-12-13 09:49:53

问题


I have a project with Cloud Composer and Cloud SQL. I am able to connect to Cloud SQL because i edited the yaml of airflow-sqlproxy-service and added my Cloud SQL instance on cloud proxy used for the airflow-db, mapping to port 3307.

The workers can connect to airflow-sqlproxy-service on port 3307 but i think the webserver can't connect to this.

Do i need to add some firewall rule to map the 3307 port so the webserver or the UI can connect to airflow-sqlproxy-service?

https://i.stack.imgur.com/LwKQK.png

https://i.stack.imgur.com/CJf7Q.png

https://i.stack.imgur.com/oC2dJ.png

Best regards.


回答1:


Composer does not currently support configuring additional sql proxies from the webserver. One workaround for cases like this is to have a separate DAG which loads Airflow Variables with the information needed from the other database (via the workers which do have access), then generate a DAG based on the Variable which the webserver can access.

https://github.com/apache/incubator-airflow/pull/4170 recently got merged (not currently available in Composer), which defines a CloudSQL connection type. This might work for these use cases in the future.



来源:https://stackoverflow.com/questions/52930935/google-cloud-composer-and-google-cloud-sql-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!