ElasticSearch REST API

ElasticSearch API

列出索引名称

curl 'http://localhost:9200/_aliases?pretty=1'

查看所有索引状态

curl 'http://localhost:9200/_stats?pretty=1'

列出集群索引

curl  'http://127.0.0.1:9200/_cat/indices?pretty=1'

查看索引大小

curl 'http://localhost:9200/_cat/indices?bytes=kb'

get all mapping

curl -XGET 'http://localhost:9200/_mapping?pretty=1'

集群健康查看

curl 'http://localhost:9200/_cat/health?v'

查看集群线程池

curl 'http://localhost:9200/_cat/thread_pool?v'

查看磁盘使用情况

curl 'http://localhost:9200/_cat/allocation?v'

节点健康查看

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

查看进程信息 打开文件数,是否锁定内存等

curl 'http://127.0.0.1:9200/_nodes/process?pretty'

集群健康

curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

关闭所有节点

curl -XPOST 'http://localhost:9200/_shutdown'

关闭指定节点

curl -XPOST 'http://localhost:9200/_cluster/nodes/nodeId1,nodeId2/_shutdown'

延迟关闭

curl -XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown?delay=10s'

在Elasticsearch集群中可以监控统计很多信息,集群健康(cluster health)。ES中用三种颜色状态表示:green,yellow,red.

Green:所有主分片和副本分片都可用

Yellow:所有主分片可用,但不是所有副本分片都可用

Red:不是所有的主分片都可用

详情请参考:http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/index.html

Elasticsearch单机多实例

su - elasticsearch -c "cd /opt/elasticsearch-1.4.2/bin;./elasticsearch -Des.config=../config/elasticsearch_node_1.yml -d"
su - elasticsearch -c "cd /opt/elasticsearch-1.4.2/bin;./elasticsearch -Des.config=../config/elasticsearch_node_2.yml -d"

安全设置

action.disable_close_all_indices: true     #禁止关闭索引
action.disable_delete_all_indices: true    #禁止删除索引
action.disable_shutdown: true              #禁止关闭节点


转载于:https://my.oschina.net/ilinux/blog/349562

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值