Hey guys,
I've been doing some fairly ornate integration testing with my app and
ES, and have hit an interesting snag. What I'm doing is creating
three nodes and shoving a bunch of data into it, but with a twist --
some of my indexes are empty (as in, the index exists but has no
documents in it yet).
This state is necessary for my application since people can create new
projects without putting any data into them and still expect their
global searches to work. If I don't create empty indexes (as in,
client.admin().indices().prepareCreate(absoluteName).execute().actionGet();),
then all my searches fail due to shard failures.
So, the side effect of having empty indexes is that if one of my nodes
goes down, the cluster status goes yellow and stays that way. It
seems that the indexes that were NOT empty get replicated properly,
but the ones that ARE empty get ignored. This also causes very
strange recovery failures when I shut down a second node, which I'm
hoping is related to the emptiness problem.
Here's what my work directory looks like with all three nodes happy:
starkey-imac:nodes stephen$ du -sh *
1.1M 0
1.2M 1
1.1M 2
starkey-imac:~ stephen$ curl -XGET 'http://192.168.0.5:9200/_cluster/
health'
{"status":"green","timed_out":false,"active_primary_shards":
220,"active_shards":440,"relocating_shards":0}s
And when I kill one of them:
starkey-imac:nodes stephen$ du -sh *
1.5M 0
1.2M 1
0B 2
starkey-imac:~ stephen$ curl -XGET 'http://192.168.0.5:9200/_cluster/
health'
{"status":"yellow","timed_out":false,"active_primary_shards":
220,"active_shards":359,"relocating_shards":0}
The problem is, I'm kind of paranoid -- I refuse to allow my
application to write into the cluster unless it's green. However,
this seriously puts a crimp in my style, since the cluster never goes
green after this happens.
Any thoughts?
Thanks in advance,
Stephen.