Set up ES cluster on Azure (Discovery problem)

I have spend a few hours trying to set up a 2 nodes cluster on Azure cloud, but it looks like ES on these two VMs cannot find each other.
Below are the thing I have done

  1. Set up a virtual network
  2. Create two vms in this network
  3. Set up ES on both vms
  4. Open ports 9200 and 9300 on Azure platform
  5. Open ports 9200 and 9300 on both Vms

Every time I tried localhost:9200/_cat/nodes, there is always 1 node. And also, publicIP:9200 doesn't work for me either. Can someone help me out? Thanks a lot.

Are you using the Azure cloud plugin or have you configured your unicast discovery so that the nodes can find each other?

Also, if you are using elasticsearch 2.0 and >, did you set network.host?

I have setup ES on Azure VMs (IaaS V2 VM) successfully with ES built-in unicast discovery mechanism.
As David mentioned, make sure set network.host if you are using ES 2.x.

As for public IP:9200, you need setup Azure load balancer. in front of VMs.

Thanks for your reply. I forgot to mention that I have set network.host: 0.0.0.0 , is it correct? and also, I am using Unicast : [10.0.0.4, 10.0.0.5].

BTW, did you follow any tutorial? Since this is the first time for me to set up a cluster, I am using this one http://thomasardal.com/running-elasticsearch-in-a-cluster-on-azure/

Thanks. As you mentioned in another thread, I have set it to 0.0.0.0. Is it correct? I guess it means ES is listening to both remote and local request.

Just to follow up, when I try to connect one vm from the other, it gives an error: Failed connect to 10.0.0.5:9200; No route to host.

And also, I have the following setup:
discovery.zen.ping.unicast.hosts: ["10.0.0.4", "10.0.0.5"]
network.host: 192.168.0.1 (default)

Thanks,

You need to set network.host: 10.0.0.5

Thanks to all of you. Finally, I got it work. It turns out there was some firewall issue (vm in virtual network need more configuration).