Nodes are leaving the cluster

There are 295 nodes in the deployment. when nodes are leaving the cluster they are saying, they could not communicate with the master node.

Is there any solution for this issue?

Which Elasticsearch version are you using?

What is the topology and configuration of the cluster?

What kind of hardware is the cluster deployed on? Is it on premise or in the cloud?

Can you share the full logs around the period a node dropped out of the cluster as well as the node that was the master at that time?

It would also help if you could provide the full output of the cluster stats API as that would give us a better understanding of the cluster.