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

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
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值