0

我想将 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$ 

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

4

2 回答 2

1

试试这个(正确的缩进)并确保你没有制表符(只有空格):

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
于 2016-05-18T12:31:59.287 回答
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
于 2016-05-18T12:30:33.897 回答