|
@@ -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": {
|