在Google Cloud Composer中配置气流SSH连接

发布于 2025-01-25 10:52:57 字数 103 浏览 5 评论 0 原文

我正在尝试配置从Google Cloud Composer环境上的气流UI到前提Posgresql Server的SSH连接 我应该在哪里存储我的私钥? 如何传递到SSH连接配置专用密钥位置?

I'm trying to configure a SSH connection from Airflow UI on google cloud composer environment to an on premise posgresql server
Where I should store my private key ?
How to pass to SSH connection config the private key location ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡離愁欲言轉身 2025-02-01 10:52:57

首先,您需要在以下方面添加一个SSH连接:

 Airflow -> Admin -> Connections -> Connection Type (SSH)

这将使您可以在操作员中使用此连接来访问远程实例。将您的键添加到额外的字段中(检查key_file& host_key)。
文档此处:

在具有DAG的同一GCS桶下添加文件将使气流工作人员可以将其触及。您可以在GADS下使用一个新目录,并在需要的情况下命名键。


然后,您将需要设计管道(DAG),以便能够从远程实例中获取私钥。
您可以根据设计使用SSHExecuteOperator或任何其他操作员。

检查此问题以获取更多有用的详细信息:
airflow> airflow'> airflow'不同的服务器

First, you will need to add an SSH connection under:

 Airflow -> Admin -> Connections -> Connection Type (SSH)

That will allow you to use this connection in an operator to access the remote instance. Add your key to the Extra field (check key_file & host_key).
Documentation here: https://airflow.apache.org/docs/apache-airflow-providers-ssh/stable/connections/ssh.html

Adding the file under the same GCS bucket having the dags will make it reachable by the Airflow workers. You can have a new directory under gads and name it keys if you want.

enter image description here
Then you will need to design your pipeline (dag) to be able to get your private key from the remote instance.
You can use the SSHExecuteOperator or any other operator based on your design.

Check this question for more helpful details:
Airflow: How to SSH and run BashOperator from a different server

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文