首页 技术 正文
技术 2022年11月15日
0 收藏 638 点赞 2,690 浏览 2265 个字

查看系统信息:

curl 'http://127.0.0.1:9200/'
curl 'http://127.0.0.1:9200/?pretty'
curl -XGET 'http://127.0.0.1:9200/?pretty'

集群(Cluster)相关:

查看集群概要信息:

curl -XGET 'http://127.0.0.1:9200/_cluster/stats?pretty'

查看集群健康状态信息:

curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty'

查看集群设置信息:

curl -XGET 'http://127.0.0.1:9200/_cluster/settings?pretty'

关闭集群分片操作

curl -XPUT http://127.0.0.1:9200/_cluster/settings?pretty=1 -d '{"persistent":{"cluster.routing.allocation.enable": "none"}}'

开启集群分片操作

curl -XPUT http://127.0.0.1:9200/_cluster/settings?pretty=1 -d '{"persistent":{"cluster.routing.allocation.enable": "all"}}'

关闭集群分片自动均衡

curl -XPUT http://127.0.0.1:9200/_cluster/settings?pretty=1 -d '{"persistent":{"cluster.routing.rebalance.enable": "none"}}'

开启集群分片自动均衡(所有分片)

curl -XPUT http://127.0.0.1:9200/_cluster/settings?pretty=1 -d '{"persistent":{"cluster.routing.rebalance.enable": "all"}}'

开启集群分片自动均衡(近针对副本分片)

curl -XPUT http://127.0.0.1:9200/_cluster/settings?pretty=1 -d '{"persistent":{"cluster.routing.rebalance.enable": "replicas"}}'

节点(Node)相关:

查看节点信息:

curl -XGET 'http://127.0.0.1:9200/_cat/nodes?v'

查看所有节点信息:

curl -XGET 'http://127.0.0.1:9200/_nodes?pretty=true'

查看指定节点(node-es-03)的信息:

curl -XGET 'http://127.0.0.1:9200/_nodes/node-es-03?pretty=true'

索引(Indices)相关:

列出集群中所有的索引:

curl -XGET 'http://127.0.0.1:9200/_nodes/node-es-03?pretty=true'

查看指定索引(date.searchlog)的状态:

curl -XGET 'http://127.0.0.1:9200/logstash-bbl/_stats?pretty'

查看指定索引(date.searchlog)的结构:

curl -XGET 'http://127.0.0.1:9200/logstash-bbl?pretty'

查看指定索引(date.searchlog)的映射结构:

curl -XGET 'http://127.0.0.1:9200/logstash-bbl/_mapping?pretty'

创建新的索引:

curl -XPUT "http://127.0.0.1:9200/logstash-bbl?pretty" -d '
{
"settings" : {
"index" : {
"refresh_interval" : "5s",
"number_of_shards" : "1",
"number_of_replicas" : "1"
}
}
}'

删除指定的索引:

curl -XDELETE http://172.16.1.141:9200/logstash-bbl

分片(Shards)相关:

查各节点中分片的分布情况:

curl -XGET 'http://127.0.0.1:9200/_cat/allocation?v'

查看集群中所有分片信息:

curl -XGET 'http://127.0.0.1:9200/_cat/shards?v'

查看指定分片信息:

curl -XGET http://127.0.0.1:9200/_cat/shards/statistics?v

迁移分片:

node-es-04 --> storage.track(3) --> node-es-01
curl -XPOST 'http://127.0.0.1:9200/_cluster/reroute' -d '{
"commands":[{
"move":{
"index":"logstash-bbl",
"shard":0,
"from_node":"node-es-04",
"to_node":"node-es-01"
}}]}'

删除副本分片:

curl -XPUT "http://127.0.0.1:9200/logstash-bbl/_settings?pretty=1" -d '{
"index" :{
"number_of_replicas" : 1
}
}'

  

[THE END]

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,498
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,911
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,745
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,502
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,141
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,304