# Elastic search cluster showing unhealthy, Cluster "red"

**URL:** https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070
**Category:** Elasticsearch
**Created:** [December 12, 2022, 8:08pm UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070 "2022-12-12T20:08:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Harsh3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@Harsh3](https://discuss.elastic.co/u/Harsh3)
#### Post date: [December 12, 2022, 8:08pm UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/1 "2022-12-12T20:08:17Z")

</div>

Hello !  
I am new to Elasticsearch! This is the first time i am doing installation, if someone can pls help, have spent days searching for the issue but no luck ..

We have kibana running inside EKS cluster and Elastic-search hosted on EC-2 instance. VPC peering is established using transit gateway. as both are different VPC

After installing Elasticsearch on EC-2 instance via Ansible , elasticsearch cluster is showing "red",  
and data nodes are not able to find the master node and shards are not getting allocated. Kibana is not able to connect to master node. i am using Elasticsearch version: 7.17.0 and kibana version 7.17.8

Have opened 9200 port for http and 9300 port internode communication

Here is my script for Elasticsearch implementation. ( during installation i was getting wait issue and finally it got timed out, so i started elasticsearch on master and date node manually. ( can anyone help me with this aswell) i am using Redhat centos rhel fedora image on EC-2 instance

```auto
---
- hosts: es-master
  become: yes
  roles:
   - role: elastic.elasticsearch
  vars:
    oss_version: false
    es_data_dirs:
      - "/data/elasticsearch/data"
    es_log_dir: "/data/elasticsearch/logs"
    es_java_install: true
    es_heap_size: "4g"
    es_config:
      cluster.name: "es-master"
      network.host: '10.90.40.5'
      cluster.initial_master_nodes: '10.90.40.5:9300'
      discovery.seed_hosts: "10.90.40.5:9300,10.90.47.153:9300"
      http.port: 9200
      node.data: false
      node.master: true
      node.ingest: false
      bootstrap.memory_lock: false
    es_plugins:
     - plugin: ingest-attachment

- hosts: es-data
  become: yes
  roles:
    - role: elastic.elasticsearch
  vars:
    oss_version: false
    es_data_dirs:
      - "/var/lib/elasticsearch"
    es_log_dir: "/data/elasticsearch/logs"
    es_java_install: true
    es_heap_size: "4g"
    es_config:
      cluster.name: "es-data"
      network.host: 10.90.47.153
      cluster.initial_master_nodes: '10.90.40.5:9300'
      discovery.seed_hosts: "10.90.40.5:9300,10.90.47.153:9300"
      http.port: 9200
      node.data: true
      node.master: false
      bootstrap.memory_lock: false
    es_plugins:
      - plugin: ingest-attachment
----------------
Health result
{
  "cluster_name" : "es-master",
  "status" : "red",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 0,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 3,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 0.0
}
------

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 13, 2022, 8:11am UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/2 "2022-12-13T08:11:20Z")

</div>

> [@Harsh3](#):
>
> `cluster.name: "es-master"`

> [@Harsh3](#):
>
> `cluster.name: "es-data"`

One thing that stands out is that you have 2 different cluster names. All nodes in a single cluster must have the same cluster name, so these 2 nodes will never be able to connect.

---

<div class="post-metadata">

### Author: ![Harsh3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@Harsh3](https://discuss.elastic.co/u/Harsh3)
#### Post date: [December 13, 2022, 8:30am UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/3 "2022-12-13T08:30:49Z")

</div>

@Christian_Dahlqvist It's basically a two separate node have taken one as master and other as data node and have given them the name as mentioned, if not what you suggest and what changes do you recommend can you please elaborate so that I can move accordingly..

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 13, 2022, 8:48am UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/4 "2022-12-13T08:48:20Z")

</div>

Have you changed the cluster name to be the same for both nodes? What does the logs show on startup?

---

<div class="post-metadata">

### Author: ![Harsh3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@Harsh3](https://discuss.elastic.co/u/Harsh3)
#### Post date: [December 13, 2022, 9:23am UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/5 "2022-12-13T09:23:50Z")

</div>

@Christian_Dahlqvist let me change the cluster name for both the nodes to a common name ,and will confirm back !  
Thanks !

---

<div class="post-metadata">

### Author: ![Harsh3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@Harsh3](https://discuss.elastic.co/u/Harsh3)
#### Post date: [December 13, 2022, 1:51pm UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/6 "2022-12-13T13:51:35Z")

</div>

@Christian_Dahlqvist Cluster came up and went green.! Thanks !

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 10, 2023, 1:52pm UTC](https://discuss.elastic.co/t/elastic-search-cluster-showing-unhealthy-cluster-red/321070/7 "2023-01-10T13:52:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
