Created
July 25, 2012 06:01
-
-
Save owenbutler/3174651 to your computer and use it in GitHub Desktop.
Elasticsearch config for split brain scenario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster.name: splitbrain | |
node.name: node1 | |
discovery.zen.minimum_master_nodes: 2 | |
discovery.zen.fd.ping_timeout: 3s | |
discovery.zen.fd.ping_retries: 2 | |
transport.tcp.connect_timeout: 2s | |
discovery.zen.node_id: zzznode1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster.name: splitbrain | |
node.name: node2 | |
discovery.zen.minimum_master_nodes: 2 | |
discovery.zen.fd.ping_timeout: 3s | |
discovery.zen.fd.ping_retries: 2 | |
transport.tcp.connect_timeout: 2s | |
discovery.zen.node_id: zzznode2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster.name: splitbrain | |
node.name: node3 | |
discovery.zen.minimum_master_nodes: 2 | |
discovery.zen.fd.ping_timeout: 3s | |
discovery.zen.fd.ping_retries: 2 | |
transport.tcp.connect_timeout: 2s | |
discovery.zen.node_id: aaanode3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java b/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java | |
index dc501f4..aaaf8ac 100644 | |
--- a/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java | |
+++ b/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java | |
@@ -166,7 +166,8 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen | |
protected void doStart() throws ElasticSearchException { | |
Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes(); | |
// note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling | |
- String nodeId = UUID.randomBase64UUID(); | |
+// String nodeId = UUID.randomBase64UUID(); | |
+ String nodeId = settings.get("discovery.zen.node_id", UUID.randomBase64UUID()); | |
localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes); | |
latestDiscoNodes = new DiscoveryNodes.Builder().put(localNode).localNodeId(localNode.id()).build(); | |
nodesFD.updateNodes(latestDiscoNodes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment