寫入日誌到 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')

這篇文章對您有幫助嗎?