跟着文档学ES命令

Health Check

curl -XGET  localhost:9200/_cat/health?v&pretty

green:集群功能是fully functional的。node

yellow:数据都是可用的,可是一些复制可能没有被分配,可是集群功能是fully functional的。json

red:一些数据是不可用的。但此时集群仍然是可用的,只是须要去修复丢失的数据了。app

查看节点列表

curl -XGET localhost:9200/_cat/nodes?v&pretty

查看索引列表

curl -XGET localhost:9200/_cat/indices?v&pretty

建立索引

curl -XPUT localhost:9200/customer?pretty&pretty
curl -XGET localhost:9200/_cat/indices?v&pretty

索引查询一个文档

curl -XPUT  localhost:9200/customer/external/1?  -H 'Content-Type: application/json' -d'
{
  "name": "John Doe"
}

待续。。。curl

相关文章
相关标签/搜索