1. 程式人生 > 實用技巧 >1423. 可獲得的最大點數 --- 滑動視窗+簡單建模

1423. 可獲得的最大點數 --- 滑動視窗+簡單建模

檢視叢集索引

curl 'http://172.30.0.133: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