elasticsearch-curl-基础命令

1,查看集群节点信息

集群的任意节点上都可以查询的 (master、date)

curl -XGET http://10.4.7.11:9200/_nodes/process?pretty

2,查询集群的健康状态

curl http://10.4.7.11:9200/_cluster/health?pretty
curl http://10.4.7.11:9200/_cluster/health/'新蔡'?pretty

3,查看集群节点属性

curl http://10.4.7.11:9200/_cat/
=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/tasks
/_cat/indices
/_cat/indices/{index}
/_cat/segments
/_cat/segments/{index}
/_cat/count
/_cat/count/{index}
/_cat/recovery
/_cat/recovery/{index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{alias}
/_cat/thread_pool
/_cat/thread_pool/{thread_pools}
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{fields}
/_cat/nodeattrs
/_cat/repositories
/_cat/snapshots/{repository}
/_cat/templates
/_cat/ml/anomaly_detectors
/_cat/ml/anomaly_detectors/{job_id}
/_cat/ml/trained_models
/_cat/ml/trained_models/{model_id}
/_cat/ml/datafeeds
/_cat/ml/datafeeds/{datafeed_id}
/_cat/ml/data_frame/analytics
/_cat/ml/data_frame/analytics/{id}
/_cat/transforms
/_cat/transforms/{transform_id}

4,查看集群索引

curl http://10.4.7.11:9200/_cat/shards
curl http://10.4.7.11:9200/_cat/shards|grep -n '新蔡'

索引模板

1,用curl创建一个索引模板
curl -H "Content-Type: application/json" -DPUT 'http://10.4.7.11:9200/_template/filebeat' -d '{
"template": "filebeat*",
"settings": {
  "number_of_shards": 5,
   "number_of_replicas": "2"
   }
}'
2,查看索引模板
a,用火狐浏览器查看

http://10.4.7.11:9200/_template/filebeat
在这里插入图片描述

b,用curl查看
curl -XGET http://10.4.7.11:9200/_template/filebeat
{"acknowledged":true}

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值