zoukankan      html  css  js  c++  java
  • Elasticsearch常用命令

    查看集群索引

    curl 'http://172.10.58.20:9200/_cat/indices'

    查看集群状态

    curl 'http://172.10.58.20:9200/_cat/health'
    curl 'http://172.10.58.20:9200/_cluster/health'

    查看分片状态

    curl -XGET 'http://172.10.58.20:9200/_cat/shards'

    查看节点为master的节点唯一标识,node:下的一串值,类似 aqNkSAuaQBiOWuLVWNOdtw

    curl 'http://172.10.58.20:9200/_nodes/process'

    分片修复(es 2.x 及之前)

    curl -XPOST 'http://172.10.58.20:9200/_cluster/reroute' -d '{
         "commands": [
            {
                "allocate": {
                    "index": "索引名字",
                    "shard": 分片序号,
                    "node": "节点标识",
                    "allow_primary": true
              }
            }
        ]
      }'

    例如:修复节点为:aqNkSAuaQBiOWuLVWNOdtw;索引为:tweets;分片序号为:0   的节点

    curl -XPOST 'http://172.10.58.20:9200/_cluster/reroute' -d '{
         "commands": [
            {
                "allocate": {
                    "index": "tweets",
                    "shard": 0,
                    "node": "aqNkSAuaQBiOWuLVWNOdtw",
                    "allow_primary": true
              }
            }
        ]
      }'

    es 5.x 及之前,将 allocate 换成 allocate_replica 

  • 相关阅读:
    SSH服务附带----SFTP
    SSH附带的远程拷贝----SCP
    linux下的SSH服务
    model.form使用,配合form的钩子
    import_module 导入变量的包
    dir函数
    python爬虫之scrapy
    python爬虫之解析库Beautiful Soup
    django 过滤器,标签
    django 验证码实现
  • 原文地址:https://www.cnblogs.com/convict/p/14086531.html
Copyright © 2011-2022 走看看