email - 带有气流的电子邮件
问题描述
我是否必须进行任何其他设置才能让 apache-airflow 向我发送有关任务失败的电子邮件。我的配置文件中有以下内容(未更改默认值):
[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 = localhost
smtp_starttls = True
smtp_ssl = False
# Uncomment and set the user/pass settings if you want to use SMTP AUTH
# smtp_user = airflow
# smtp_password = airflow
smtp_port = 25
smtp_mail_from = airflow@example.com
在我的任务中,我有
'email': ['my.email@domain.co.uk'],
'email_on_failure': True,
但是当任务失败时,它不会向我发送电子邮件。
我看到了这个问题:如何设置 Airflow 的电子邮件配置以发送错误电子邮件?但我真的不明白要从中采取什么行动。我只是在寻找气流发送电子邮件之前需要做什么的基础知识。我是否必须配置我自己的 smtp 服务器,还是应该开箱即用?
我在 CentOS 上运行 apache-airflow 1.9.0
解决方案
您将需要自己的 SMTP 服务。我们在内部使用 Mailgun 和 Sendgrid,效果很好。您只需要.cfg
使用凭据更改这些行,重新启动气流,就可以开始了!
推荐阅读
- java - 如何溢出堆?
- java - 杰克逊的 ObjectMapper 的单个实例不起作用
- ios - iPad:针对不同分辨率的项目的具体/准确位置
- c# - 正则表达式解析两个标记之间的字符串,没有捕获组和排除标记
- ios - 尝试获取对象值时应用程序正在终止
- java - 如何获取哈希图中的arrayList的大小
- css - 无法在嵌套的弹性控件中显示点
- python - 在函数内部实现“全局变量”后未定义名称“变量”
- regex - 如何使用 htaccess 将 IPS 4.x url 重定向到 XenForo 2
- python - ECS Airflow 1.10.2 性能问题。操作员和任务需要 10 倍的时间