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

需要迁移的索引

  1. [appdeploy@cnsz17pl2429 ~]$ curl -s http://10.110.106.167:9200/_cat/indices?v|grep t_stock~
  2. green open t_stock~2021-06 Emj5eHXjRRqeP38RSA_e3Q 5 1 81550660 25035097 246gb 122.7gb
  3. green open t_stock~2021-05 HhxBtjvVQ6KD-k0v-_X1sw 5 1 71722966 20264849 198.4gb 99.4gb
  4. green open t_stock~2021-07 GlhVSU-LS0-Rgmryw5uJ_g 5 1 20732949 9653092 76.8gb 37.6gb
  5. green open t_stock~2021-04 BIktzgXvTvSptHpFE26jTg 5 1 74012331 12908355 186gb 93gb

新建索引

  1. curl -s -uelastic:Bdp1@elastic -XPOST http://10.150.92.6:9200/_template/t_stock -H 'Content-Type:application/json' -d'
  2. {
  3. "order" : 1,
  4. "template" : "t_stock~*",
  5. "settings" : {
  6. "index" : {
  7. "number_of_shards" : "5",
  8. "number_of_replicas" : "1",
  9. "routing" : {
  10. "allocation" : {
  11. "total_shards_per_node" : "7"
  12. }
  13. }
  14. }
  15. },
  16. "mappings" : {
  17. "_default_" : {
  18. "dynamic_templates" : [
  19. {
  20. "strings_not_analyzed" : {
  21. "mapping" : {
  22. "ignore_above" : 256,
  23. "index" : "not_analyzed",
  24. "type" : "keyword"
  25. },
  26. "match_mapping_type" : "string"
  27. }
  28. }
  29. ]
  30. },
  31. "t_stock" : {
  32. "properties" : {
  33. "waybillQuantity" : {
  34. "type" : "double"
  35. },
  36. "chargeWeight" : {
  37. "type" : "double"
  38. },
  39. "inputOper" : {
  40. "type" : "keyword"
  41. },
  42. "outputCode" : {
  43. "type" : "keyword"
  44. },
  45. "opRouteCode" : {
  46. "type" : "keyword"
  47. },
  48. "modifier" : {
  49. "type" : "keyword"
  50. },
  51. "waybillActualWeight" : {
  52. "type" : "double"
  53. },
  54. "inputTime" : {
  55. "type" : "keyword"
  56. },
  57. "limitTypeCode" : {
  58. "type" : "keyword"
  59. },
  60. "sourceCityCode" : {
  61. "type" : "keyword"
  62. },
  63. "destCityCode" : {
  64. "type" : "keyword"
  65. },
  66. "packageNo" : {
  67. "type" : "keyword"
  68. },
  69. "productName" : {
  70. "type" : "keyword"
  71. },
  72. "actualWeight" : {
  73. "type" : "double"
  74. },
  75. "modifyTime" : {
  76. "type" : "keyword"
  77. },
  78. "waybillVolume" : {
  79. "type" : "double"
  80. },
  81. "routeCode" : {
  82. "type" : "keyword"
  83. },
  84. "inputCode" : {
  85. "type" : "keyword"
  86. },
  87. "creator" : {
  88. "type" : "keyword"
  89. },
  90. "destCityName" : {
  91. "type" : "keyword"
  92. },
  93. "platformNumber" : {
  94. "type" : "keyword"
  95. },
  96. "waybillChargeWeight" : {
  97. "type" : "double"
  98. },
  99. "sourceCityName" : {
  100. "type" : "keyword"
  101. },
  102. "waybillPackage" : {
  103. "type" : "keyword"
  104. },
  105. "cargoTypeCode" : {
  106. "type" : "keyword"
  107. },
  108. "volume" : {
  109. "type" : "double"
  110. },
  111. "marshallingStation" : {
  112. "type" : "keyword"
  113. },
  114. "productCode" : {
  115. "type" : "keyword"
  116. },
  117. "createTime" : {
  118. "type" : "keyword"
  119. },
  120. "sourceZoneCode" : {
  121. "type" : "keyword"
  122. },
  123. "expressTypeCode" : {
  124. "type" : "keyword"
  125. },
  126. "srcCode" : {
  127. "type" : "keyword"
  128. },
  129. "destZoneCode" : {
  130. "type" : "keyword"
  131. },
  132. "outputTime" : {
  133. "type" : "keyword"
  134. },
  135. "destAreaCode" : {
  136. "type" : "keyword"
  137. },
  138. "zoneCode" : {
  139. "type" : "keyword"
  140. },
  141. "outputOper" : {
  142. "type" : "keyword"
  143. },
  144. "status" : {
  145. "type" : "keyword"
  146. },
  147. "waybillNo" : {
  148. "type" : "keyword"
  149. }
  150. }
  151. }
  152. },
  153. "aliases" : {
  154. "t_stock" : { }
  155. }
  156. }'

5.4->5.4
首先需要添加白名单

  1. reindex.remote.whitelist: "10.110.106.167:9200"
  1. curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
  2. {
  3. "source": {
  4. "size": 5000,
  5. "remote": {
  6. "host": "http://10.110.106.167:9200"
  7. },
  8. "index": "t_stock~2021-04",
  9. },
  10. "dest": {
  11. "index": "t_stock~2021-04",
  12. }
  13. }' &
  14. curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
  15. {
  16. "source": {
  17. "size": 5000,
  18. "remote": {
  19. "host": "http://10.110.106.167:9200"
  20. },
  21. "index": "t_stock~2021-04",
  22. },
  23. "dest": {
  24. "index": "t_stock~2021-05",
  25. }
  26. }' &
  27. curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
  28. {
  29. "source": {
  30. "size": 5000,
  31. "remote": {
  32. "host": "http://10.110.106.167:9200"
  33. },
  34. "index": "t_stock~2021-04",
  35. },
  36. "dest": {
  37. "index": "t_stock~2021-06",
  38. }
  39. }' &
  40. curl -XPOST -H 'Content-Type:application/json' http://10.150.92.1:9200/_reindex?pretty -d '
  41. {
  42. "source": {
  43. "size": 5000,
  44. "remote": {
  45. "host": "http://10.110.106.167:9200"
  46. },
  47. "index": "t_stock~2021-04",
  48. },
  49. "dest": {
  50. "index": "t_stock~2021-07",
  51. }
  52. }' &

5.4->7.6

  1. reindex.remote.whitelist: "http://10.150.92.1:9200"
  1. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
  2. {
  3. "source": {
  4. "size": 5000,
  5. "remote": {
  6. "host": "http://10.150.92.1:9200"
  7. },
  8. "index": "t_stock~2021-04",
  9. },
  10. "dest": {
  11. "index": "t_stock~2021-04",
  12. }
  13. }' &
  14. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
  15. {
  16. "source": {
  17. "size": 5000,
  18. "remote": {
  19. "host": "http://10.150.92.1:9200"
  20. },
  21. "index": "t_stock~2021-05",
  22. },
  23. "dest": {
  24. "index": "t_stock~2021-05",
  25. }
  26. }' &
  27. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
  28. {
  29. "source": {
  30. "size": 5000,
  31. "remote": {
  32. "host": "http://10.150.92.1:9200"
  33. },
  34. "index": "t_stock~2021-06",
  35. },
  36. "dest": {
  37. "index": "t_stock~2021-06",
  38. }
  39. }' &
  40. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.6:9200/_reindex?pretty -d '
  41. {
  42. "source": {
  43. "size": 5000,
  44. "remote": {
  45. "host": "http://10.150.92.1:9200"
  46. },
  47. "index": "t_stock~2021-07",
  48. },
  49. "dest": {
  50. "index": "t_stock~2021-07",
  51. }
  52. }' &

7.6->7.7

  1. http://10.150.92.6:9200
  1. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
  2. {
  3. "source": {
  4. "size": 5000,
  5. "remote": {
  6. "host": "http://10.150.92.6:9200",
  7. "username":"elastic",
  8. "password":"Bdp1@elastic"
  9. },
  10. "index": "t_stock~2021-04",
  11. },
  12. "dest": {
  13. "index": "t_stock~2021-04",
  14. }
  15. }' &
  16. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
  17. {
  18. "source": {
  19. "size": 5000,
  20. "remote": {
  21. "host": "http://10.150.92.6:9200",
  22. "username":"elastic",
  23. "password":"Bdp1@elastic"
  24. },
  25. "index": "t_stock~2021-05",
  26. },
  27. "dest": {
  28. "index": "t_stock~2021-05",
  29. }
  30. }' &
  31. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
  32. {
  33. "source": {
  34. "size": 5000,
  35. "remote": {
  36. "host": "http://10.150.92.6:9200",
  37. "username":"elastic",
  38. "password":"Bdp1@elastic"
  39. },
  40. "index": "t_stock~2021-06",
  41. },
  42. "dest": {
  43. "index": "t_stock~2021-06",
  44. }
  45. }' &
  46. curl -XPOST -H 'Content-Type:application/json' -uelastic:Bdp1@elastic http://10.150.92.11:9200/_reindex?pretty -d '
  47. {
  48. "source": {
  49. "size": 5000,
  50. "remote": {
  51. "host": "http://10.150.92.6:9200",
  52. "username":"elastic",
  53. "password":"Bdp1@elastic"
  54. },
  55. "index": "t_stock~2021-07",
  56. },
  57. "dest": {
  58. "index": "t_stock~2021-07",
  59. }
  60. }' &