elasticsearch migrates the index data of the remote server to the local index through _reindex

elasticsearch migrates the index data of the remote server to the local index through _reindex

Process operations after using kibana to connect to the es database


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"
	}
}

During the migration process, the following error occurs: 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
}

A whitelist needs to be added to the elasticsearch.yml configuration file of the new cluster machine.
The whitelist means that es on the remote specified IP are allowed to access my es.
Add in the elasticsearch.yml file: reindex.remote.whitelist: ["ip:9200", "ip2:9200"]
Note: 1. Use commas to separate multiple IP addresses. 2. Configuration needs to be performed on both the source ES and the target ES.

reindex.remote.whitelist: 192.168.2.2:9200

Guess you like

Origin blog.csdn.net/qq_37959253/article/details/129668946