ElasticSearch 获取es信息以及索引操作

检查集群的健康情况

GET /_cat/health?v
http://192.168.47.101:9200/_cat/health?v

创建索引

PUT /test_index

{
   "settings" : {
      "number_of_shards" : 1,
      "number_of_replicas" : 1
   }
}

test_index 表示索引的名称
number_of_shards 表示分片数
number_of_replicas 表示副本数
在这里插入图片描述

查看索引

GET /_cat/indices?v
http://192.168.47.101:9200/_cat/indices?v
在这里插入图片描述

green:每个索引的primary shard和replica shard都是active状态的
yellow:每个索引的primary shard都是active状态的,但是部分replica shard不是active状态,处于不可用的状态
red:不是所有索引的primary shard都是active状态的,部分索引有数据丢失了

删除索引

DELETE /test_index
在这里插入图片描述

修改索引副本数

PUT /my_temp_index/_settings

{
“number_of_replicas”: 2
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值