I am planning on load-balancing my read's and write's across a 2 replicas, 5 shards cluster.
Here's an example of my python code:
from pyes import ES
conn=ES(['primary.1:9200', 'replica.1:9200', 'replica.2:9200'])
Write's: conn.index(doc, index, doc_type, id=id, bulk=True)
Read's: conn.search(query, indexes=[index])
conn.get(...)
The reason for load-balanced write's/read's is the primary box is seeing 80% CPU spikes quite often. We have pretty high read/write traffic. All boxes are 64GB memory, 8 core EC2 instances. I was hoping a multiple server list in the ES() call will automagically distribute the read's and write's.
Questions:
- I searched for previous posts on read's and came across this thread: http://elasticsearch-users.115913.n3.nabble.com/How-to-fix-primary-replica-inconsistency-td4022692.html#a4024176 which I just posted a question to. Is this still an issue? I'm running 0.19.2
- I couldn't find any threads on write's - not the way I'm planning anyway. Please share your experiences and advice.
- Am I doing it right(from the above code snippet)?
Thanks.