Kibana 如何将elasticsearch的索引从旧服务器迁移到新服务器

u5rb5r59  于 5个月前  发布在  Kibana
关注(0)|答案(3)|浏览(142)

我有一个索引在旧的elasticsearch服务器在6.2.0版本(windows服务器),现在我试图将其移动到新的服务器(Linux)上7.6.2版本的elasticsearch.我试图下面的命令将我的索引从旧的迁移到新的服务器,但它抛出一个异常.

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://MyOldDNSName:9200"
    },
    "index": "test"
  },
  "dest": {
    "index": "test"
  }
}

字符串
我得到的例外是-

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "[MyOldDNSName:9200] not whitelisted in reindex.remote.whitelist"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "[MyOldDNSName:9200] not whitelisted in reindex.remote.whitelist"
  },
  "status" : 400
}


注意:我没有在新的ElasticSearch服务器中创建任何索引。我必须用我的旧模式创建它,然后尝试执行上述命令吗?

fcipmucu

fcipmucu1#

错误消息很清楚,您试图在新主机(Linux)上构建索引的远程主机(在您的情况下是windows)没有列入白名单,请参阅Elasticsearch指南了解如何从远程重新索引更多信息。
根据同一文件
远程主机必须使用reindex.remote.whitelist属性在elasticsearch.yml中显式地列入白名单。它可以设置为允许的远程主机和端口组合的逗号分隔列表(例如otherhost:9200,another:9200,127.0.10.:9200,localhost:)。
另一个有用的discuss link来解决这个问题。

velaa5lx

velaa5lx2#

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-reindex.html#reindex-from-remote
将其添加到elasticsearch.yml中,根据您的环境修改它:

reindex.remote.whitelist: "otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*"

字符串

yzxexxkh

yzxexxkh3#

在字符串错误"host": "http://MyOldDNSName:9200"
不使用http时正确

POST _reindex
{
  "source": {
    "remote": {
      "host": "MyOldDNSName:9200"

字符串

相关问题