將日誌寫入 HDFS

遠端日誌記錄到 HDFS 使用現有的 Airflow 連線來讀取或寫入日誌。如果您沒有正確設定連線,此過程將失敗。

啟用遠端日誌記錄

要啟用此功能,airflow.cfg 必須按如下方式配置

[logging]
# Airflow can store logs remotely in HDFS. Users must supply a remote
# location URL (starting with either 'hdfs://...') and an Airflow connection
# id that provides access to the storage location.
remote_logging = True
remote_base_log_folder = hdfs://some/path/to/logs
remote_log_conn_id = webhdfs_default

在上述示例中,Airflow 將嘗試使用 WebHDFSHook('webhdfs_default')

此條目有幫助嗎?