I was wondering why do i have number of nodes: 2 when i am running it on a single machine.
Perhaps Logstash is connecting using the node protocol? That would certainly explain why you have two nodes but only one data node.
I read up on the net that it's foolhardy to disable replicas. But currently i can run it on a single machine only. Is there a way i can maintain it well on a single machine or disabling replicas is the only way to go about it.
You could run multiple ES nodes on the same physical machine, but why would you want to do that? If the machine goes down all your data is unavailable either way. It basically just adds overhead.
Also i haven't worked on configuration of Elasticsearch, suppose if i do end up running it on two machines. How can i control which one is master and which one is replica.
ES dynamically chooses which node is the master node (there are no replica nodes, only replica shards). Apart from being able to configure a node to not want to become a master you can't affect the mastership election. Same thing with primary and replica shards; there are times when you want control over that but it's unusual and for now you should stick to the program and don't worry about it.
As discussed in a recent thread here, you should never have two master-eligible nodes. With two nodes it's wise to disable mastership for one of them, or jump directly to three nodes (where all are master-eligible).