gmail 阻止了我的弹性搜索观察者电子邮件

gmail is blocking my elastic search watcher email

我正在使用 ES 5.2。我实施了一个 watcher.But 每次观察者被触发时它都会生成电子邮件,但 google 出于安全考虑阻止了该电子邮件。那么有什么解决办法呢?

我的 YML 文件如下:

cluster.name:elasticsearch-logging

node.name: "elasticsearch-logging-0"

path.data: /var/lib/elasticsearch/data

xpack.notification.email.account:

gmail_account:

个人资料:gmail

smtp:

认证:真

starttls.enable: 真

主持人:smtp.gmail.com

端口:587

用户:******.**@gmail.com

密码:******

在 watcher 上做卷曲时得到低于响应:

做卷曲 --

curl -XGET localhost:9200/_xpack/watcher/watch/last_watch

获得以下响应:

{
  "found": true,
  "id": "lastwatch",
  "status": {
    "version": 5,
    "state": {
      "active": true,
      "timestamp": "2017-06-16T00:39:16.654Z"
    },
    "lastchecked": "2017-06-16T00:43:00.229Z",
    "last_met_condition": "2017-06-16T00:43:00.229Z",
    "actions": {
      "email_admin": {
        "ack": {
          "timestamp": "2017-06-16T00:39:16.654Z",
          "state": "awaits_successful_execution"
        },
        "last_execution": {
          "timestamp": "2017-06-16T00:43:00.229Z",
          "successful": false,
          "reason": "MessagingException[failed to send email with subject [404 recently encountered] via account [gmail_account]]; nested: AuthenticationFailedException[534-5.7.14 https://accounts.google.com/signin/continue?sarp=1&scc=1&pltn534-5.7.14 q0WEdpll7GFx7wL5ZoIKlaHy0JIWKkJEAaiNf5hWY11ZPPsJb6u7h9z0Xe\n534-5.7.14 kWiT264a1EJgbKW5ESeccxI0uUZ_3X4klQS4jBjB7dDw6pRU490p-yKtXkL2-Ik\n534-5.7.14 vMoQFBgYsmH2WbbGFC3Z63GBpWVH0O9LmpVsB89ZsSreIXN_bb0AX3UWwoX4dTb4UiXtmi\nQI Please log in via your web browser and\n534-5.7.14 then try again.\n534-5.7.14 Learn more at\n534 5.7.14 https://support.google.com/mail/answer/78754 a22sm752699pfc.115 - gsmtp\n]; "
        }
      }
    }
  },
  "watch": {
    "trigger": {
      "schedule": {
        "cron": "0 0/1 * * * ?"
      }
    },
    "input": {
      "search": {
        "request": {
          "search_type": "query_then_fetch",
          "indices": [
            "logstash*"
          ],
          "types": [],
          "body": {
            "query": {
              "bool": {
                "must": {
                  "match": {
                    "methodName": "getSSLConnectionSocketFactory"
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition": {
      "compare": {
        "ctx.payload.hits.total": {
          "gt": 0
        }
      }
    },
    "actions": {
      "email_admin": {
        "email": {
          "profile": "standard",
          "to": [
            "****.*****@gmail.com"
          ],
          "subject": "404 recently encountered"
        }
      }
    }
  }
}

看起来像 javax.mail issue and you need to turn on less secure apps