curl -s IP:9200/performance_v1_20200225/_alias?pretty
curl -XPOST "IP:9200/_aliases" -H 'Content-Type: application/json' -d
'{"actions" : [{ "add" : { "index" : "index_par_rel_v4", "alias" : "index_par_rel2" } }]}'
curl -XPOST "IP:9200/_aliases" -H 'Content-Type: application/json' -d
'{"actions" : [{ "remove" : { "index" : "index_par_rel_v4", "alias" : "index_par_rel" } }]}'
curl -XGET http://192.168.92.128:9201/_cat/shards
curl -XGET http://192.168.92.128:9201/_cat/shards |grep gb
curl -s -XGET http://192.168.0.12:9200/_cat/shards|grep -v START
curl -s ip:9200/_cat/indices/index_name
[green open name id 主分片数 副本数 doc条数 doc删除过的条数 store大小 主分片大小]
curl -XGET localhost:9200/_cat/templates 查看所有模板名称
curl -XGET localhost:9200/_template/template_1 查看 template_1 模板的内容
curl -s -XGET http://191.168.92.128:9200/_cat/tasks?v|grep -Ev ''monitor|write"
curl -s -XGET http://191.168.92.128:9200/_cat/pening_task?v
curl -s -XGET http://191.168.92.128:9200/_node/hot_threads|less
curl -s -XGET "http://192.168.92.129:9200/_cat/nodes?v
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.21.50 52 99 6 0.12 0.29 0.28 mdi * IRQAfVp
ip:集群中节点的ip地址
heap.percent: 堆内存的占用百分比
ram.percent: 总内存的占用百分比,其实这个不是很准确,因为 buff/cache和available 也被当作使用内存
cpu: cpu占用百分比
load_1m: 1分钟内cpu负载
load_5m: 5分钟内cpu负载
load_15m: 15分钟内cpu负载
node.role: mdi分别表示 master、data、ingest
master:* *代表是master节点,- 代表普通节点
name: 节点的名称
-- 索引分片不分配到192.168.0.x的主机
curl -s -XPUT http://192.168.92.128:9200/logindex-2019-09-21/_settings -H 'Content-Type:application/json' -d '
{ "settings":{"index.routing.allocation.exclude._ip":"192.168.0.*"}}'
-- 每个节点可以分配3个相同的分片
curl -s -XPUT http://192.168.92.128:9200/logindex-2019-09-21/_settings -H 'Content-Type:application/json' -d '
{ "routing.allocation.total_shards_per_node":"3"}'
curl -s -XGET http://192.168.92.128:9200/_scripts/脚本名字?pretty
curl -s "http://192.168.92.128:9200/_cluster/state/metadata?pretty&filter_path=metadata.stored_scripts"
curl -s 'https://nginx:123456@192.168.92.128:92/00/_cluster/health?pretty'
curl -kg -XGET https://logstash:logstash@localhost:9200/_cat/shards?v
curl -s -XPOST -H 'Content-Type: application/json' http://192.168.92.128:9201/_cluster/allocation/explain?pretty -d '
{
"index": "test",
"shard": 4,
"primary": false
}
# 如果出现 类似 报错 "explanation": "shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call
# curl -s -H 'Content-Type:application/json' -XPOST 192.168.1.63:9200/_cluster/reroute?retry_failed=true
即可将这类分片重新分配