Skip to content

Commit 2a842b6

Browse files
committed
improve master-eligible node detection in node-rotation
1 parent a834a66 commit 2a842b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/elasticsearch/elasticsearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class Elasticsearch {
3737
return this.execute(`/_nodes/${instance.privateIp}`).then((json: any) => {
3838
if (json._nodes.total === 1) {
3939
const nodeId: string = Object.keys(json.nodes)[0];
40-
const isMasterEligible: boolean = json.nodes[nodeId].settings.node.master == 'true';
40+
const isMasterEligible: boolean = json.nodes[nodeId].settings.node.master == 'true' || json.nodes[nodeId].settings.node.roles.includes('master');
4141
return new ElasticsearchNode(instance, nodeId, isMasterEligible);
4242
} else {
4343
throw `expected information about a single node, but got: ${JSON.stringify(json)}`;

0 commit comments

Comments
 (0)