错误:必须在elasticsearch.yml中配置smtp.host

时间:2016-05-18 12:25:22

标签: elasticsearch elasticsearch-plugin elasticsearch-watcher

我想将Watcher插件与elasticsearch集成。所以,为此,我在elasticsearch.yml中添加了以下配置:

watcher.actions.email.service.account:
  outlook_account:
    profile: outlook
  smtp:
    auth: true
    starttls.enable: true
    host: smtp-mail.outlook.com
    port: 587
    user: abc@example.com
    password: abc

但是当我使用bin / elasticsearch运行elasticsearch时,它给了我这个:

L-IDC1ZCG3QC-M:elasticsearch-2.2.0 pgoel$ bin/elasticsearch
[2016-05-18 17:50:43,783][INFO ][node                     ] [Rocket Raccoon] version[2.2.0], pid[5189], build[8ff36d1/2016-01-27T13:32:39Z]
[2016-05-18 17:50:43,783][INFO ][node                     ] [Rocket Raccoon] initializing ...
[2016-05-18 17:50:44,183][INFO ][plugins                  ] [Rocket Raccoon] modules [lang-expression, lang-groovy], plugins [watcher, license], sites []
[2016-05-18 17:50:44,202][INFO ][env                      ] [Rocket Raccoon] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [182.6gb], net total_space [232.6gb], spins? [unknown], types [hfs]
[2016-05-18 17:50:44,202][INFO ][env                      ] [Rocket Raccoon] heap size [989.8mb], compressed ordinary object pointers [true]
[2016-05-18 17:50:44,232][INFO ][watcher.trigger.schedule ] [Rocket Raccoon] using [ticker] schedule trigger engine
[2016-05-18 17:50:45,534][INFO ][node                     ] [Rocket Raccoon] initialized
[2016-05-18 17:50:45,534][INFO ][node                     ] [Rocket Raccoon] starting ...
Exception in thread "main" SettingsException[missing required email account setting for account [smtp]. 'smtp.host' must be configured]
    at org.elasticsearch.watcher.actions.email.service.Account$Config.<init>(Account.java:182)
    at org.elasticsearch.watcher.actions.email.service.Accounts.<init>(Accounts.java:40)
    at org.elasticsearch.watcher.actions.email.service.InternalEmailService.createAccounts(InternalEmailService.java:109)
    at org.elasticsearch.watcher.actions.email.service.InternalEmailService.reset(InternalEmailService.java:105)
    at org.elasticsearch.watcher.actions.email.service.InternalEmailService.doStart(InternalEmailService.java:55)
    at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:68)
    at org.elasticsearch.node.Node.start(Node.java:242)
    at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:221)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:287)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
[2016-05-18 17:50:45,547][INFO ][node                     ] [Rocket Raccoon] stopping ...
[2016-05-18 17:50:45,548][INFO ][node                     ] [Rocket Raccoon] stopped
[2016-05-18 17:50:45,548][INFO ][node                     ] [Rocket Raccoon] closing ...
[2016-05-18 17:50:45,552][INFO ][node                     ] [Rocket Raccoon] closed
L-IDC1ZCG3QC-M:elasticsearch-2.2.0 pgoel$ 

有人可以帮帮我吗?我在哪里做错了?

2 个答案:

答案 0 :(得分:1)

您的缩进错误(yaml对此很挑剔),smtp部分应位于outlook_account部分。

watcher.actions.email.service.account:
  outlook_account:
    profile: outlook
    smtp:
      auth: true
      starttls.enable: true
      host: smtp-mail.outlook.com
      port: 587
      user: abc@example.com
      password: abc

答案 1 :(得分:1)

尝试这样做(正确的缩进)并确保没有TAB(只有空格):

watcher.actions.email.service.account: 
  outlook_account: 
    profile: outlook
    smtp: 
      auth: true
      host: smtp-mail.outlook.com
      password: abc
      port: 587
      starttls.enable: true
      user: abc@example.com
相关问题