Rediger

Del via


Tutorial: Configure Apache Ambari email notifications in Azure HDInsight

In this tutorial, you configure Apache Ambari email notifications by using SendGrid as an example. Apache Ambari simplifies the management and monitoring of an Azure HDInsight cluster by providing an easy-to-use web UI and REST API. Ambari is included on HDInsight clusters and is used to monitor the cluster and make configuration changes. SendGrid is a free cloud-based email service that provides reliable transactional email delivery, scalability, and real-time analytics along with flexible APIs that make custom integration easy. Azure customers can unlock 25,000 free emails each month.

Note

SendGrid isn't mandatory to configure Ambari email notifications. You can also use other third-party email apps, like Outlook and Gmail.

In this tutorial, you learn how to:

  • Obtain a SendGrid username.
  • Configure Ambari email notifications.

Prerequisites

Note

Users can no longer set passwords for their SendGrid accounts. You need to use an API key to send email.

Obtain a SendGrid API key

  1. In the Azure portal, go to your SendGrid resource.

  2. On the Overview page, select Open SaaS Account on publisher’s site to go to the SendGrid webpage for your account.

    Screenshot that shows a SendGrid overview in the Azure portal.

  3. On the left menu, go to Settings and then select API Keys.

    Screenshot that shows SendGrid dashboard navigation.

  4. Select Create API Key to create an API key. Copy the API key as an SMTP password to use later.

    Screenshot that shows SendGrid account details.

Configure Ambari e-mail notification

  1. Use a web browser to go to https://CLUSTERNAME.azurehdinsight.net/#/main/alerts, where CLUSTERNAME is the name of your cluster.

  2. In the Actions dropdown list, select Manage Notifications.

  3. On the Manage Alert Notifications pane, select the + icon.

    Screenshot that shows the Manage Alert Notifications dialog box.

  4. In the Create Alert Notification dialog, provide the following information:

    Property Description
    Name Provide a name for the notification.
    Groups Configure as desired.
    Severity Configure as desired.
    Description Optional.
    Method Leave as EMAIL.
    Email To Provide emails to receive notifications, separated by a comma.
    SMTP Server smtp.sendgrid.net
    SMTP Port Use 25 or 587, for unencrypted/Transport Layer Security (TLS) connections.
    Email From Provide an email address. The address doesn't need to be authentic.
    Use authentication Select this checkbox.
    Username Use apikey directly if you use SendGrid.
    Password Provide the password that you copied when you created the SendGrid API key in Azure.
    Password Confirmation Reenter password.
    Start TLS Select this checkbox.

    Screenshot that shows the Create Alert Notification dialog.

  5. Select Save to return to the Manage Alert Notifications pane.

  6. On the Manage Alert Notifications pane, select Close.

FAQ

This section describes a problem that you might encounter.

No appropriate protocol error if the Start TLS checkbox is selected

If you select the Start TLS checkbox in the Create Alert Notification dialog and you receive a No appropriate protocol exception in the Ambari server log:

  1. Go to the Ambari UI.
  2. Go to Alerts > ManageNotifications > Edit (Edit Notification).
  3. Select Add Property.
  4. Add the new property mail.smtp.ssl.protocols with a value of TLSv1.2.

In this tutorial, you learned how to configure Ambari email notifications by using SendGrid. To learn more about Ambari, see the following articles: