Elasticsearch medium
What is the primary risk of having a Cluster with 2 Master-eligible nodes and a network partition?
- A The nodes will run significantly slower due to increased latency between them.
- B 'Split Brain': If both nodes lose connection and each can't find a majority, they may both either stop working (no master) or both try to be master, leading to data corruption and divergence.
- C The nodes won't be able to store more than 100GB of data.
- D The REST API will automatically switch to Read-Only mode permanently.
Answer: B. 'Split Brain': If both nodes lose connection and each can't find a majority, they may both either stop working (no master) or both try to be master, leading to data corruption and divergence.
To avoid Split Brain, you need an odd number (3, 5, 7) of Master-eligible nodes. A quorum is `(N/2)+1`. In a 3-node setup, a partition of '1' and '2' means the '2' side has a majority and can safely continue. In a 2-node setup, neither side can ever have a majority of the original set, paralyzing the cluster.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What are the two primary reasons for configuring one or more 'Replica Shards' for an index?
- When a String field is mapped as `text`, what process is performed to enable full-text search capability?
- What is the primary benefit of splitting an Elasticsearch index into multiple 'Primary Shards'?
- Every document stored in an Elasticsearch index is uniquely tracked by which mandatory metadata field?
- Elasticsearch search results include a metadata field called `_score`. What does this value primarily indicate?
- What is the primary architectural purpose of Elasticsearch in a modern software stack?