我正在使用官方 Docker 映像运行分布式 Airflow 2.4.0 设置。所有容器都使用相同的.env文件和相同版本的 Airflow 镜像。当我登录到 Airflow 容器之一时,我收到此警告:
/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:545: DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
option = self._get_environment_variables(deprecated_key, deprecated_section, key, section)
/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:545: DeprecationWarning: The auth_backend option in [api] has been renamed to auth_backends - the old setting has been used, but please update your config.
option = self._get_environment_variables(deprecated_key, deprecated_section, key, section)
/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
FutureWarning,
Run Code Online (Sandbox Code Playgroud)
我检查了airflow.cfg容器内部,它具有最新的变量。为什么我仍然收到警告消息?
您因该部分而看到这些警告。airflow.cfg是带有部分的配置文件。设置预计位于正确的部分。
在您的情况下,您的airflow.cfg 可以sql_alchemy_conn覆盖默认值。在 2.3.0 之前,此设置位于核心部分,在 2.3.0 中,它被移至数据库部分。(见公关)
您需要做的只是打开airflow.cfg并将设置移动到适当的部分。例如:
[core]
sql_alchemy_conn = sqlite:///{AIRFLOW_HOME}/airflow.db
Run Code Online (Sandbox Code Playgroud)
到:
[database]
sql_alchemy_conn = sqlite:///{AIRFLOW_HOME}/airflow.db
Run Code Online (Sandbox Code Playgroud)
文档中也解释了为什么会这样。Airflow 参考设置由环境变量的格式决定AIRFLOW__{SECTION}__{KEY},因此在本例中它将是:
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN因此该部分对于查找变量很重要。
| 归档时间: |
|
| 查看次数: |
7196 次 |
| 最近记录: |