With the settings you have in place, 2 master eligible nodes need to be available in the cluster in order for one of them to be elected master and the cluster to operate properly. If you only have one node started, what you are seeing is expected and correct, as this prevents a single node that gets partitioned off from the rest of the cluster, e.g. due to a network problem, to continue accepting data that could get lost..
what should be the value for discovery.zen.minimum_master_nodes to avoid above error.
I want to configure ES clusters to avoid downtime and also to avoid split brain situations. If possible please suggest good cluster setup like how many minimum nodes and what should be there roles like
If all nodes are master-eligible that would be the case. For larger clusters it is however common to have 3 dedicated master nodes, and of these 2 need to be available at all times. If you want to be able to lose any 2 nodes and still operate, you could have 5 master eligible nodes instead.