Sandeep's answer above hinted to me that nodes aren't able to talk to each other. When I dug more into this, I found that I was missing inbound rule for TCP, port 9300 in EC2's security group. Added the rules and restarted elasticsearch service on all nodes and it started working.