arkantos_xan
arkantos_xan

Reputation: 11

Starting multiple nodes do not allocate replica shards

So, I had just started out with Elasticsearch on my local machine.

I have started 5 instances of Elasticsearch nodes. (simple ./bin/elasticsearch)

curl -s 'localhost:9200/_cat/nodes?v' gives:

host      ip        heap.percent ram.percent load node.role master name
127.0.0.1 127.0.0.1            5          99 3.13 d         m      Shirow Ishihara
127.0.0.1 127.0.0.1            7         100 3.13 d         m      Madame Web
127.0.0.1 127.0.0.1            5         100 3.13 d         m      Anthropomorpho
127.0.0.1 127.0.0.1            5         100 3.13 d         m      Paste-Pot Pete
127.0.0.1 127.0.0.1            2         100 3.13 d         *      Mephisto

My index has 2 primary shards and 5 replicas (total 10 replicas).

I had read that ES automatically scales horizontally and assigns/moves shards to new nodes. However, still all the 10 replicas are unassigned and both the 2 primary shards are in the same node.

curl -s 'localhost:9200/_cat/allocation?v' gives:

shards disk.indices disk.used disk.avail disk.total disk.percent host      ip        node
     0           0b   105.5gb      6.2gb    111.8gb           94 127.0.0.1 127.0.0.1 Shirow Ishihara
     0           0b   105.5gb      6.2gb    111.8gb           94 127.0.0.1 127.0.0.1 Paste-Pot Pete
     2         318b   105.5gb      6.2gb    111.8gb           94 127.0.0.1 127.0.0.1 Mephisto
     0           0b   105.5gb      6.2gb    111.8gb           94 127.0.0.1 127.0.0.1 Anthropomorpho
     0           0b   105.5gb      6.2gb    111.8gb           94 127.0.0.1 127.0.0.1 Madame Web
    10                                                                               UNASSIGNED

Upvotes: 1

Views: 327

Answers (1)

Andrei Stefan
Andrei Stefan

Reputation: 52368

You have too few available disk space an ES is actually trying to move away some shards. But all your nodes are on the same machine so there is nowhere else where to move them and they stay unassigned. The used disk space is more than 90% of the total disk size and ES is hitting the the high watermark.

Read here more about this.

Upvotes: 0

Related Questions