【问题标题】:How do you export/import "index-pattern" types in Kibana如何在 Kibana 中导出/导入“索引模式”类型
【发布时间】:2016-05-24 20:39:43
【问题描述】:

Kibana 4.3 具有用于导入/导出仪表板、搜索和可视化的强大功能。但是,生成的 export.json 文件中不包含相关的索引模式。将 export.json 文件导入另一个 kibana 索引时,Kibana 报告错误Could not locate that index-pattern-field (id: <index-pattern name>)

如何将 kibana 的索引模式从一个 Elasticsearch 实例迁移到另一个实例?

谢谢,

内森

【问题讨论】:

    标签: elasticsearch kibana kibana-4


    【解决方案1】:

    来自official documentation(已添加重点)

    导出的仪表板不包括其关联的索引模式。在将保存的仪表板导入另一个 Elasticsearch 集群上运行的 Kibana 实例之前,手动重新创建索引模式

    由于索引模式与其他任何东西一样保存在.kibana 索引中,您可以做的而不是手动重新创建它们,是使用临时工具保存它们,例如(例如)elasticdump,像这样:

    elasticdump \
      --input=http://host1:9200/.kibana \
      --input-index=.kibana/index-pattern \
      --output=http://host2:9200/.kibana \
      --output-index=.kibana/index-pattern \
      --type=data
    

    您也可以在 .kibana 索引上使用 snapshot/restore

    【讨论】:

    【解决方案2】:

    对于任何试图将 AWS elasticsearch 实例从一个集群迁移到新集群的人...(希望这会有所帮助...)

    我遇到了与 OP 类似的问题(我试图使用 AWS instructions 将数据从一个 AWS Elasticsearch 实例迁移到一个新实例)。 出于某种原因,集群的恢复将失败并出现以下神秘错误。

    "cannot restore index [.kibana] because it's open" 
    

    经过多次谷歌搜索和挠头后,我决定将 .kibana 索引单独迁移到其余索引会更容易

    我尝试了@Val 的绝妙建议来使用elasticdump,但是,@Val 的示例对我不起作用。

    我最终基于 elasticdump 自述文件中的示例执行命令,

      elasticdump \
      --input=https://search-some-prod-instance.ap-southeast-2.es.amazonaws.com/.kibana \
      --output=https://search-other-prod-instance.ap-southeast-2.es.amazonaws.com/.kibana \
      --type=data
    

    运行此命令后,旧 kibana 中的索引现在可以在新 kibana 中使用。 (最后:p)

    nb:我还使用了 kibana“管理->保存的对象导出/导入”来迁移我的可视化、搜索、仪表板等...

    【讨论】:

    • "cannot restore index [.kibana] because it's open" 表示您需要close .kibana 索引才能恢复。因为你无法恢复到打开的索引中
    • @SandeepKanabar - 是的,意识到这一点。您是否有可用的命令来关闭 AWS 托管的 Elasticsearch 上的开放索引?还是文档的参考/链接?
    • POST <index_name>/_close 来自elastic.co/guide/en/elasticsearch/reference/5.5/…
    • 非常感谢@SandeepKanabar,我会将其纳入我的备份策略:)
    猜你喜欢
    • 1970-01-01
    • 2021-05-29
    • 2020-01-03
    • 1970-01-01
    • 1970-01-01
    • 2018-07-28
    • 2017-05-25
    • 1970-01-01
    • 2015-09-16
    相关资源
    最近更新 更多