本人设置过程:邮件发送方:网易163 邮件接收方:qq邮箱
第一步:
开通网易163的smtp服务功能(百度so easy),并且获取授权码。
第二步:
设置airflow里的airflow.cfg配置文件如下例子:
[email]
email_backend = airflow.utils.email.send_email_smtp
[smtp]
# If you want airflow to send emails on retries, failure, and you want to use
# the airflow.utils.email.send_email_smtp function, you have to configure an
# smtp server here
smtp_host = smtp.163.com
smtp_starttls = True
smtp_ssl = False
# Uncomment and set the user/pass settings if you want to use SMTP AUTH
smtp_user = user@163.com
smtp_password = password # 163邮箱配置的授权码
smtp_port = 25
smtp_mail_from = user@163.com
第三步:
编写作业
from airflow import DA
Airflow教程:配置邮件报警功能
本教程详细介绍了如何在Airflow中设置报警功能,通过启用网易163的SMTP服务并配置Airflow的airflow.cfg文件,实现邮件通知。以测试任务test2触发的错误为例,展示了当任务执行失败时,如何接收到报警邮件。
订阅专栏 解锁全文
2470





