Org.elasticsearch.action.UnavailableShardsException


(Slava G ) #1

Hi,
I have java code that index documents.
This code worked fine when I worked with index name for the indexing.
Now I switched to use alias instead of index name and I started to get
this exception:
org.elasticsearch.action.UnavailableShardsException [index][0] [3]
shardIt, [1] active : Timeout waiting for [1m], request: index
{[index]...

My index cluster is one computer (localhost), the connection to es is
fine and I can create index and alias.
But indexing doc is failed.
May be my usage of the alias instead of index name is wrong for
indexing doc ?

Thank You.


(Shay Banon) #2

There isn't really a different between using an alias and an index, the
mentioned failure means that the shard has not been allocated (yet) on the
cluster.

On Sun, Apr 29, 2012 at 12:06 AM, slavag slavago@gmail.com wrote:

Hi,
I have java code that index documents.
This code worked fine when I worked with index name for the indexing.
Now I switched to use alias instead of index name and I started to get
this exception:
org.elasticsearch.action.UnavailableShardsException [index][0] [3]
shardIt, [1] active : Timeout waiting for [1m], request: index
{[index]...

My index cluster is one computer (localhost), the connection to es is
fine and I can create index and alias.
But indexing doc is failed.
May be my usage of the alias instead of index name is wrong for
indexing doc ?

Thank You.


(Slava G ) #3

I think i fixed this by reducing number of replicas.
Thank You.

On Apr 29, 8:56 pm, Shay Banon kim...@gmail.com wrote:

There isn't really a different between using an alias and an index, the
mentioned failure means that the shard has not been allocated (yet) on the
cluster.

On Sun, Apr 29, 2012 at 12:06 AM, slavag slav...@gmail.com wrote:

Hi,
I have java code that index documents.
This code worked fine when I worked with index name for the indexing.
Now I switched to use alias instead of index name and I started to get
this exception:
org.elasticsearch.action.UnavailableShardsException [index][0] [3]
shardIt, [1] active : Timeout waiting for [1m], request: index
{[index]...

My index cluster is one computer (localhost), the connection to es is
fine and I can create index and alias.
But indexing doc is failed.
May be my usage of the alias instead of index name is wrong for
indexing doc ?

Thank You.


(Shay Banon) #4

Did you have somethign like 4 replicas and started only one node case? In
this case, yes, indexing will fail because it, by default, requires a
quorum of shards to be available. See more on write consistency in the
index API docs.

On Thu, May 3, 2012 at 6:48 PM, slavag slavago@gmail.com wrote:

I think i fixed this by reducing number of replicas.
Thank You.

On Apr 29, 8:56 pm, Shay Banon kim...@gmail.com wrote:

There isn't really a different between using an alias and an index, the
mentioned failure means that the shard has not been allocated (yet) on
the
cluster.

On Sun, Apr 29, 2012 at 12:06 AM, slavag slav...@gmail.com wrote:

Hi,
I have java code that index documents.
This code worked fine when I worked with index name for the indexing.
Now I switched to use alias instead of index name and I started to get
this exception:
org.elasticsearch.action.UnavailableShardsException [index][0] [3]
shardIt, [1] active : Timeout waiting for [1m], request: index
{[index]...

My index cluster is one computer (localhost), the connection to es is
fine and I can create index and alias.
But indexing doc is failed.
May be my usage of the alias instead of index name is wrong for
indexing doc ?

Thank You.


(system) #5