zoukankan      html  css  js  c++  java
  • 设置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.smtp.smtp.com
    smtp_starttls = False
    smtp_ssl = True    
    # Uncomment and set the user/pass settings if you want to use SMTP AUTH
    smtp_user = 邮箱名
    smtp_password = smtp_password 
    smtp_port = 465
    smtp_mail_from = 发件人

    smtp_starttls基本上意味着使用TLS
    如果要改用SSL,请将此设置设置为False,并将smtp_ssl设置为True。您可能需要smtp_usersmtp_password两种方法

    因为我邮箱在服务器上开通的是SSL传输,所以打开了 smtp_ssl

    二 . 脚本中配置 

    args = {
        'owner': 'airflow',
        'start_date': start_date,
        'email': ['email@163.com'],
        'email_on_failure': True,    #失败之后再次发送
        'email_on_retry': True,
        'depends_on_past': True,
    }

    三 . 效果

  • 相关阅读:
    数据绘图工具之Matplotlib
    数据分析
    scrapy-redis 实现分布式爬虫
    存储库之MongoDB
    pycharm解释器链接如何pymongo
    爬虫之request相关请求
    爬虫基本原理
    Xadmin
    当网页失去焦点时改变网页的title值
    gulp基础使用及进阶
  • 原文地址:https://www.cnblogs.com/zmc940317/p/13293685.html
Copyright © 2011-2022 走看看