Elasticsearch-当我在Mac上用Docker启动Metricbeat时,没有创建新的索引



我按照本指南更改metricbeat.yml如下,以便让Elasticsearch每天创建新的索引,例如metricbeat-7.5.0-2020.02.02-0000001

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["localhost:9200"]
ilm.enabled: true
ilm.pattern: "{now/M{yyyy.MM}}-000001"

以下是控制台输出:

[index management]idxmgmt/std.go:182在启用ILM时将output.aelasticsearch.index设置为"metricbeat-7.5.0">
elasticsearch/client.go:171弹性搜索网址:https://YYY.azure.elastic-cloud.com:443
[publisher]pipeline/module.go:97节拍名称:XXX.local
instance/Beat.go:429节拍开始运行
[monitoring]log/log.go:118每30秒启动一次指标日志记录
cfgfile/reload.go:171配置重新加载程序启动
cfgfile/reload.go:226配置文件加载完成
add_cloud_metadata/add_cloud_matadata.go:89 add_cloud_metadata:未检测到宿主提供程序类型
管道/输出.go:95连接到回退(弹性搜索(https://YYY.azure.elastic-cloud.com:443))
elasticsearch/client.go:753尝试连接到elasticsearch版本7.5.0
[index management]idxmgmt/std.go:256自动ILM成功
[index management.ilm]ilm/std.go:138不生成ilm策略:exists=true,overwrite=false
[idex management]idxmgmt/std.go:269成功加载ilm策略
[index management]idxmgmt/std.go:408在启用ILM时,将setup.template.name设置为"{metricbeat-7.5.0{now/d}-000001}">
[index management]idxmgmt/std.go:413在启用ILM时将setup.template.pattern设置为"metricbeat-7.5.0-*">
[index management]idxmgmt/std.go:447在启用ILM时,将模板中的settings/index.lifecycle.rollover_alias设置为{metricbeat-7.5.0{now/d}-000001}
[index management]idxmgmt/std.go:451在启用ILM时,将模板中的settings/index.lifecycle.name设置为{metricbeat-7.5.0{"policy":{"phases":{
template/load.go:89模板metricbeat-7.5.0已存在,不会被覆盖
[index management]idxmgmt/std.go:293已加载索引模板
[索引管理]idxmgmt/std.go:304写入别名生成成功。

您是如何配置docker容器网络的?我的猜测是,运行metricbeat的容器的localhost与您弹性搜索侦听的localhost不同。请尝试用host.docker.internal替换metricbeat.yml中的localhost

这篇文章应该会帮助你:

https://docs.docker.com/docker-for-mac/networking/#use-案例和解决方法

最新更新