elasticsearch 通过 _reindex迁移远程服务器的索引数据至本地索引

在尝试通过Kibana使用Elasticsearch的_reindexAPI从远程服务器迁移索引数据到本地索引时,遇到了notwhitelistedinreindex.remote.whitelist的错误。该错误是由于远程IP未在reindex.remote.whitelist配置中。解决方案是在源和目标Elasticsearch集群的elasticsearch.yml文件中添加远程IP的白名单,例如:reindex.remote.whitelist:[192.168.2.2:9200]。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

elasticsearch 通过 _reindex迁移远程服务器的索引数据至本地索引

使用kibana连接上es数据库后进程操作


POST _reindex
{
	"source":{
		"index":"remote_persion",
		"size":1000   //可选,每次批量提交1000个,可以提高效率,建议每次提交5-15M的数据
     	"query": {}  // 可选, 不写的默认是全量数据迁移 写上条件就是选择性迁移数据
		"remote":{
				"host":"http://192.168.2.2:19200",
				"username":"aaa",
				"password":"qqq"
				}
			},
	"dest": {
		"index":"local_persion"
	}
}

在迁移过程中,会出现下列错误not whitelisted in reindex.remote.whitelist

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

需要在新集群机器elasticsearch.yml配置文件中添加白名单,
白名单表示允许远程指定ip上的es访问我的es
在elasticsearch.yml文件中添加:reindex.remote.whitelist: [“ip:9200”,”ip2:9200”]
注意:1、多个ip地址时用逗号间隔 2、在源es与目标es上都需要进行配置。

reindex.remote.whitelist: 192.168.2.2:9200
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值