bdp-pst54-ssd es压测集群/5.4
10.150.92.1
10.150.92.2
10.150.92.3
10.150.92.4
10.150.92.5
bdp-pst76-ssd es压测集群/7.6
10.150.92.6
10.150.92.7
10.150.92.8
10.150.92.9
10.150.92.10
bdp-pst77-ssd es压测集群/7.7
10.150.92.11
10.150.92.12
10.150.92.13
10.150.92.14
10.150.92.15
curl http://10.150.92.6:9200/_cluster/health?pretty
curl -s -uelastic:Bdp1@elastic http://10.150.92.6:9200/_cluster/health?pretty
curl -s -uelastic:Bdp1@elastic http://10.150.92.11:9200/_cluster/health?pretty
集群数据迁移
bdp-eos-fms-ssd-dr master节点:10.110.106.167,10.110.106.168,10.110.106.169
需要迁移的索引
[appdeploy@cnsz17pl2429 ~]$ curl -s http://10.110.106.167:9200/_cat/indices?v|grep t_stock~
green open t_stock~2021-06 Emj5eHXjRRqeP38RSA_e3Q 5 1 81550660 25035097 246gb 122.7gb
green open t_stock~2021-05 HhxBtjvVQ6KD-k0v-_X1sw 5 1 71722966 20264849 198.4gb 99.4gb
green open t_stock~2021-07 GlhVSU-LS0-Rgmryw5uJ_g 5 1 20732949 9653092 76.8gb 37.6gb
green open t_stock~2021-04 BIktzgXvTvSptHpFE26jTg 5 1 74012331 12908355 186gb 93gb
新建索引
curl -s -uelastic:Bdp1@elastic -XPOST http://10.150.92.6:9200/_template/t_stock -H 'Content-Type:application/json' -d'
{
"order" : 1,
"template" : "t_stock~*",
"settings" : {
"index" : {
"number_of_shards" : "5",
"number_of_replicas" : "1",
"routing" : {
"allocation" : {
"total_shards_per_node" : "7"
}
}
}
},
"mappings" : {
"_default_" : {
"dynamic_templates" : [
{
"strings_not_analyzed" : {
"mapping" : {
"ignore_above" : 256,
"index" : "not_analyzed",
"type" : "keyword"
},
"match_mapping_type" : "string"
}
}
]
},
"t_stock" : {
"properties" : {
"waybillQuantity" : {
"type" : "double"
},
"chargeWeight" : {
"type" : "double"
},
"inputOper" : {
"type" : "keyword"
},
"outputCode" : {
"type" : "keyword"
},
"opRouteCode" : {
"type" : "keyword"
},
"modifier" : {
"type" : "keyword"
},
"waybillActualWeight" : {
"type" : "double"
},
"inputTime" : {
"type" : "keyword"
},
"limitTypeCode" : {
"type" : "keyword"
},
"sourceCityCode" : {
"type" : "keyword"
},
"destCityCode" : {
"type" : "keyword"
},
"packageNo" : {
"type" : "keyword"
},
"productName" : {
"type" : "keyword"
},
"actualWeight" : {
"type" : "double"
},
"modifyTime" : {
"type" : "keyword"
},
"waybillVolume" : {
"type" : "double"
},
"routeCode" : {
"type" : "keyword"
},
"inputCode" : {
"type" : "keyword"
},
"creator" : {
"type" : "keyword"
},
"destCityName" : {
"type" : "keyword"
},
"platformNumber" : {
"type" : "keyword"
},
"waybillChargeWeight" : {
"type" : "double"
},
"sourceCityName" : {
"type" : "keyword"
},
"waybillPackage" : {
"type" : "keyword"
},
"cargoTypeCode" : {
"type" : "keyword"
},
"volume" : {
"type" : "double"
},
"marshallingStation" : {
"type" : "keyword"
},
"productCode" : {
"type" : "keyword"
},
"createTime" : {
"type" : "keyword"
},
"sourceZoneCode" : {
"type" : "keyword"
},
"expressTypeCode" : {
"type" : "keyword"
},
"srcCode" : {
"type" : "keyword"
},
"destZoneCode" : {
"type" : "keyword"
},
"outputTime" : {
"type" : "keyword"
},
"destAreaCode" : {
"type" : "keyword"
},
"zoneCode" : {
"type" : "keyword"
},
"outputOper" : {
"type" : "keyword"
},
"status" : {
"type" : "keyword"
},
"waybillNo" : {
"type" : "keyword"
}
}
}
},
"aliases" : {
"t_stock" : { }
}
}'
5.4->5.4
首先需要添加白名单
reindex.remote.whitelist: "10.110.106.167:9200"
curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.110.106.167:9200"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-04",
}
}' &
curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.110.106.167:9200"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-05",
}
}' &
curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.110.106.167:9200"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-06",
}
}' &
curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.110.106.167:9200"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-07",
}
}' &
5.4->7.6
reindex.remote.whitelist: "http://10.150.92.1:9200"
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.1:9200"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-04",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.1:9200"
},
"index": "t_stock~2021-05",
},
"dest": {
"index": "t_stock~2021-05",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.1:9200"
},
"index": "t_stock~2021-06",
},
"dest": {
"index": "t_stock~2021-06",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.1:9200"
},
"index": "t_stock~2021-07",
},
"dest": {
"index": "t_stock~2021-07",
}
}' &
7.6->7.7
http://10.150.92.6:9200
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.6:9200",
"username":"elastic",
"password":"Bdp1@elastic"
},
"index": "t_stock~2021-04",
},
"dest": {
"index": "t_stock~2021-04",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.6:9200",
"username":"elastic",
"password":"Bdp1@elastic"
},
"index": "t_stock~2021-05",
},
"dest": {
"index": "t_stock~2021-05",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.6:9200",
"username":"elastic",
"password":"Bdp1@elastic"
},
"index": "t_stock~2021-06",
},
"dest": {
"index": "t_stock~2021-06",
}
}' &
curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
{
"source": {
"size": 5000,
"remote": {
"host": "http://10.150.92.6:9200",
"username":"elastic",
"password":"Bdp1@elastic"
},
"index": "t_stock~2021-07",
},
"dest": {
"index": "t_stock~2021-07",
}
}' &