Elastic search master issue

Jun 05 13:00:53 ip-172-31-43-63 elasticsearch[505]: [2024-06-05T13:00:53,419][INFO ][o.e.x.s.a.AuthenticationService] [es_euwest_prd_ec2_2] Authentication of [elastic] was terminated by realm [rese
rved] - failed to authenticate user [elastic]
Jun 05 13:00:53 ip-172-31-43-63 elasticsearch[505]: [2024-06-05T13:00:53,521][INFO ][o.e.x.s.a.AuthenticationService] [es_euwest_prd_ec2_2] Authentication of [elastic] was terminated by realm [rese
rved] - failed to authenticate user [elastic]
Jun 05 13:00:54 ip-172-31-43-63 elasticsearch[505]: [2024-06-05T13:00:54,768][WARN ][o.e.c.c.ClusterFormationFailureHelper] [es_euwest_prd_ec2_2] master not discovered or elected yet, an election r
equires at least 2 nodes with ids from [b4neNNbhSCuBmrDRoiCOYA, -N7Cqt1UQgqO0x558XXjFg, hNeYTYIsSES7A7eobhOMhQ], have discovered [{es_euwest_swinnr_prd_ec2_2}{hNeYTYIsSES7A7eobhOMhQ}{T5D446xeS_KGJ5TJBtIl5
w}{172.31.43.63}{172.31.43.63:9300}{dim}{aws_availability_zone=eu-west-1b, ml.machine_memory=3910221824, xpack.installed=true, ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [1
27.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304, 127.0.0.1:9305, [::1]:9301, [::1]:9302, [::1]:9303, [::1]:9304, [::1]:9305, 172.31.27.100:9300, 172.31.43.63:9300, 172.31.11.13:9300] from ho
sts providers and [{es_euwest_prd_ec2_2}{hNeYTYIsSES7A7eobhOMhQ}{T5D446xeS_KGJ5TJBtIl5w}{172.31.43.63}{172.31.43.63:9300}{dim}{aws_availability_zone=eu-west-1b, ml.machine_memory=3910221824, xpack.
installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 53, last-accepted version 1182 in term 53
Jun 05 13:01:04 ip-172-31-43-63 elasticsearch[505]: [2024-06-05T13:01:04,769][WARN ][o.e.c.c.ClusterFormationFailureHelper] [es_prd_ec2_2] master not discovered or elected yet, an election r
equires at least 2 nodes with ids from [b4neNNbhSCuBmrDRoiCOYA, -N7Cqt1UQgqO0x558XXjFg, hNeYTYIsSES7A7eobhOMhQ], have discovered [{es_euwest_swinnr_prd_ec2_2}{hNeYTYIsSES7A7eobhOMhQ}{T5D446xeS_KGJ5TJBtIl5
w}{172.31.43.63}{172.31.43.63:9300}{dim}{aws_availability_zone=eu-west-1b, ml.machine_memory=3910221824, xpack.installed=true, ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [1
27.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304, 127.0.0.1:9305, [::1]:9301, [::1]:9302, [::1]:9303, [::1]:9304, [::1]:9305, 172.31.27.100:9300, 172.31.43.63:9300, 172.31.11.13:9300] from ho
sts providers and [{es_euwest_prd_ec2_2}{hNeYTYIsSES7A7eobhOMhQ}{T5D446xeS_KGJ5TJBtIl5w}{172.31.43.63}{172.31.43.63:9300}{dim}{aws_availability_zone=eu-west-1b, ml.machine_memory=3910221824, xpack.
installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 53, last-accepted version 1182 in term 53

curl -X GET 'http://localhost:9200'
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}},"status":401}Preformatted text

Hi @gedrasaknagufum.com,

Welcome! I see you've posted log snippets without a lot of context. Can you please give more information such as the version of Elasticsearch you are using, how you are running Elasticsearch, what behaviour you are seeing or what issue you are trying to solve?

Looking at the logs snippets I see a couple of potential issues:

  1. You have an authentication issue:
  1. There is an issue finding the master node:

If it's your first time spinning up the cluster you may need to set property cluster.initial_master_nodes as covered here. Alternatively I would look at this article which discusses some potential causes.

Hope that helps!