Jelajahi Sumber

更新es7 bidding mapping

wcc 2 tahun lalu
induk
melakukan
0a5a8fc8cb
3 mengubah file dengan 28 tambahan dan 3 penghapusan
  1. 4 1
      mapping/biddingmapping2.txt
  2. 1 1
      mapping/projectset.txt
  3. 23 1
      mapping/tool.txt

+ 4 - 1
mapping/biddingmapping2.txt

@@ -93,7 +93,10 @@ curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/bidding
           "type": "keyword"
         },
         "isValidFile": {
-        "type": "boolean"
+          "type": "boolean"
+        },
+        "dataweight": {
+          "type": "long"
         },
         "agency": {
           "type": "keyword",

+ 1 - 1
mapping/projectset.txt

@@ -55,7 +55,7 @@ curl -XPUT http://127.0.0.1:19800/projectset_v1 -d '{
           }
         }
       },
-      "number_of_shards": "15",
+      "number_of_shards": "20",
       "number_of_replicas": "0"
     }
   },

+ 23 - 1
mapping/tool.txt

@@ -46,6 +46,19 @@ curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
     "cluster.routing.allocation.enable" : "none"
   }
 }'
+//开启节点平衡,es7 环境,需要传递header参数
+curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+//关闭节点平衡
+curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+
 //手动移动节点
 curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{
     "commands" : [ {
@@ -86,7 +99,16 @@ curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
     }
 	}
 }'
-
+//新增某字段mapping,es7 版本
+curl -XPUT "http://192.168.3.149:9200/bidding_v2/_mapping" -H 'Content-Type: application/json' -d'
+{
+  "properties": {
+    "dataweight": {
+      "type": "long"
+    }
+  }
+}
+'
 curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
 {
 	"properties": {