Master node's Elasticsearch sometimes dead while ingested data from filebeat

So if you have one node and added a 'data' node then you have two nodes, one master/data and one data. Which makes more sense. Make sure the master node has more RAM, and if they both have it, make both mater (but need a voting master also if V7, so you have three).

As @rugenl notes, check the Java garbage collection logs to see how long GC is taking. Something is stalling, which is usually GC, but also do you have any swapping enabled on these VMs or happening?

And you mention "Master node's elasticsearch could die sometimes" - what does that mean, die how? What is in its logs like of heap, or kernel logs like OOM or something, etc.