如何使用 Airflow 解决 Postgres 连接的连接超时错误

clu*_*s92 5 postgresql sqlalchemy psycopg2 airflow

当我运行气流 DAG 时,连接超时。当我早上运行它时,它每天都会发生。每次第一次尝试时,它都会发生在相同的任务步骤上。

\n
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection timed out\n    Is the server running on host \xe2\x80\x9chostname.domain.com\xe2\x80\x9d (99.999.999.99) and accepting\n    TCP/IP connections on port 77777?\n
Run Code Online (Sandbox Code Playgroud)\n

我检查了数据库连接,连接正常。我的数据库没有任何停机时间。

\n

我从您可以从气流 UI 获取的日志中复制了此错误。有谁知道这个错误的原因可能是什么?

\n