Replica Shards allocation in nodes

(Julian Somoza) #1


I have 2 nodes:

Node 1 elasticsearch "belerian"
node.master: true true false ["gondolin.cabib.local"]

Node 2 elasticsearch "gondolin"
node.master: false true false ["belerian.cabib.local"]

The problem is that the status is Yellow...

1444988073 04:34:33 elasticsearch yellow 3 2 45 45 0 0 45

And the nodes are there...

belerian 27 20 3.60 d * belerian
belerian 36 c - logstash-belerian-1799-11646
gondolin 7 23 0.01 d - gondolin

If I check allocation with api...

45 26.1gb 48.6gb 74.7gb 34 belerian belerian
0 0b belerian logstash-belerian-1799-11646
0 10.6gb 34.9gb 45.5gb 23 gondolin gondolin

The node dont appear in Marvel plugin...

All the indices have yellow state...

What's my mistake? What can I do to send replicas to the other nodes?

Thanks in advance!

(Ed) #2

Since you disabled multicast you need to list both hosts in your server list. That is the fist thing I see that might influence the second node from appearing And if you have replication on with no second node there is no place for the replicas to go, hence yellow

See if that helps, I'll look more too at the details you gave

(Julian Somoza) #3

Thanks for your help!

I turn to true the option but 45 shards still unallocated...

I will continue reading out while I wait some help.


(Ed) #4

if you have two nodes and it is not working try this little script to re-allocated the unallocated shards

You have to update the SETYOURNODENAME in the script.

#DEBUG enable next line
set -x
#set #-x
curl -sk -XGET http://$HOSTNAME:$PORT/_cat/shards | grep UNASSIGNED | awk '{ print $1 " " $2 }'| while read ind shard
    echo " Moving $ind Shard $shard to YOURNODENAME"
    curl -ks -XPOST "$HOSTNAME:$PORT/_cluster/reroute" -d '{
        "commands" : [ {
              "allocate" : {
                  "index" : "'$ind'",
                  "shard" : '$shard',
                  "node" : "SETYOURNODENAME",
                  "allow_primary" : true
    }' > /dev/null

(Julian Somoza) #5

Changing that parameter to true make the diference! Thanks!!

(system) #6