All:
I have a few scaling questions that I wanted to get input on. First a
little background, our company uses ES currently at an older version,
0.17.7, due to scheduling concerns, taking down the index to do major
version upgrades is very difficult for us and we have use across an older
code base that we will be shutting down next month before we upgrade to
0.19.x. We have 6 current indices varying in size from a single small
document that will likely not grow to an index with around 700k documents
that grows a few thousand a day, all the way up to 500 million documents,
this largest index grows at around 750k documents a day, all of the
documents in question are rather small. We run our index across 6 nodes
with 12 shards per index and 1 replica to allow for growth and redundancy,
I have no idea if this is suboptimal, if we should be using a different
number of shards for the smaller indexes, if we should be using more shards
for the larger one, etc.
We are having periodic issues with our current setup, some of which I am
sure are addressed in the versions we have yet to upgrade to. One that hit
me yesterday is our cluster ended up with 3 nodes thinking they were the
master in the same cluster, the only way I was able to resolve this was to
restart the offending nodes, and ultimately any other nodes that agreed
that the false master nodes were the master, this lead to some data loss as
I was not able to keep all the shards/replicas for a given index up before
restarting the offending nodes. While we still have the source data to
recreate the documents the process to do so requires walking a filesystem
and doing shallow parses on millions of files, it will take several days to
weeks to figure out what data is missing and replace it. I don't know if I
hit a bug or if I don't have things configured correctly. I am considering
storing the documents as raw json in Postgres as well just to increase the
speed of recovery in case the cluster loses data again. All of our data
nodes are configured the same and I will include the yaml file at the end
of this post.
Additionally durring times that the largest index is collapsing segments
and times when a node fails and shards need to be reallocated our java
clients get timeouts when trying to post data to the cluster. When all
shards have been reallocated or the index finishes being optimized these
issues clear up. I can't immagine this is intended behavior so I clearly
have done something wrong, I just don't know what.
Finally, what is the best way to back up ES and for that matter safely
restore from backup either in the case of a disaster or for testing
purposes to another cluster? Our index is so spread out and we can't really
suffer shutting it down, our largest index is over 500 GB so any rsync
strategy will take a long time and have to come from several boxes
depending on where the shards are.
If anyone could provide some best practice pointers for a setup like mine I
would greatly appreciate it. Please refrain from just saying "upgrade to
0.19.x" as that is already in the works, I'm more looking to make sure I'm
not doing something inadvertently very stupid.
Thanks in advance for any suggestions,
--Dan
-- yaml config follows
cluster:
name: grid
path:
logs: /var/log/es
data: /var/grid/index
bootstrap:
mlockall: true
index:
term_index_divisor: 4
number_of_shards: 12
number_of_replicas: 1
merge:
scheduler:
max_thread_count: 4
discovery:
zen:
ping_timeout: 30s
jmx:
create_connector: true
transport:
netty:
worker_count: 64