How do i fix Unassigned Replicas on cluster?

Hello,

we recently created a cluster on 2 VMs , 1 with Elasticsearch as MASTER node and another with Elasticsearch as DATA node . How do i allocate the replicas ? it seems the primary is allocated but the replicas arent.

We had a single node set up till last week and today we tried our hand with the cluster setup

 curl 172.26.207.168:9200/_cat/nodes?v
ip             heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
172.26.207.168           29          99  90   32.40   24.52    17.36 d         -      Nexus_elasticsearch_dev02
172.26.207.164           57          92   2    0.40    0.25     0.14 m         *      Nexus_elasticsearch_dev01
req_lines                     0 p STARTED    4436417 827.3mb 172.26.207.168 Nexus_elasticsearch_dev02
req_lines                     0 r UNASSIGNED                                
c_lines                       0 p STARTED    1621071 248.8mb 172.26.207.168 Nexus_elasticsearch_dev02
c_lines                       0 r UNASSIGNED                                
gmon_lines                0 p STARTED      57000  22.8mb 172.26.207.168 Nexus_elasticsearch_dev02
gmon_lines                0 r UNASSIGNED                                
dnsp_lines                    0 p STARTED    6902280 345.1mb 172.26.207.168 Nexus_elasticsearch_dev02
dnsp_lines                    0 r UNASSIGNED                                
f_lines                       0 p STARTED     922366 203.4mb 172.26.207.168 Nexus_elasticsearch_dev02
f_lines                       0 r UNASSIGNED                                
.kibana_task_manager_7.15.0_001     0 p STARTED         15   1.4mb 172.26.207.168 Nexus_elasticsearch_dev02
.apm-custom-link                    0 p UNASSIGNED                                
.kibana_7.15.0_001                  0 p STARTED        132   4.8mb 172.26.207.168 Nexus_elasticsearch_dev02
.apm-agent-configuration            0 p UNASSIGNED                                
.kibana-event-log-7.15.0-000001     0 p STARTED          1     6kb 172.26.207.168 Nexus_elasticsearch_dev02
.ds-ilm-history-5-2021.12.01-000001 0 p UNASSIGNED

and the output of GET /_cluster/health , incase if it helps to fix this

{
  "cluster_name" : "ELK-nexus",
  "status" : "red",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 8,
  "active_shards" : 8,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 8,
  "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" : 50.0
}

You can not as the dedicated master node can not hold data. If you change it into a master/data node the replicas should get assigned assuming you have enough space.

thanks for the response @Christian_Dahlqvist . Could you tell me if having a master node is a requirement in a cluster set up ?

you said "If you change it into a master/data node the replicas should get assigned assuming you have enough space." - can a node have multiple roles i.e to be both a master and data node ?

For small clusters having dedicated master nodes is usually not required. If you are startring out I would start with 1 or 3 nodes that have all roles.

1 Like

yup, we are just starting out :slight_smile: thanks a lot for your answers .

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