全文檢索技術_設置索引默認分片和副本個數

可以通過elasticsearch-head-master設置。elasticsearch-head-master的安裝,可以參見文章:全文檢索技術_elasticsearch-head-master插件的下載安裝

通過瀏覽器進入,選擇複合查詢選項卡:
在這裏插入圖片描述
查詢地址:輸入你對應服務elasticsearch的地址。
索引模板選擇:

_template/template_http_request_record

提交方式:put

json提交內容:
以下的內容提交成功後,將爲之後的索引創建默認生成5個分片和一個副本。

{"index_patterns":["*"],"settings":{"number_of_shards":5,"number_of_replicas":1}}

如果需要在linux執行: 將一下192.168.43.88換成你elasticsearch所在服務器的ip

curl -XPUT 'http://192.168.43.88:9200/_template/template_http_request_record' -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"settings": {"number_of_shards": 5,"number_of_replicas": 1}}'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章