Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Connecting two Virtual Machines using

$
0
0

Apologies if this question overlaps with some of the others suggested.

I have two Virtual Machines, VM A to host a website (Apache/PHP) and VM B to host the database (MySQL). Each VM is on its own cloud service and there is no Virtual Network to keep them connected. In this scenario, I have two options:

  • I specify in VM A the internal IP of VM B (which may change when VM B is restarted, forcing me to update the configuration in VM A);
  • I specify in VM A the access to VM B using B's Public virtual IP (VIP) address. However, using this method, name resolution does not always work. Say I refresh the website on my browser five times, VM A will try to connect to VM B (for MySQL access) five times. But only about three attempts work. The other two fail with "mysqli_connect(): (HY000/2005): Unknown MySQL server host 'vm-my-bd-vm.cloudapp.net' (20)". It seems to me that Azure's internal DNS resolution is having some problems.

From my understanding, the second method is supposed to work always, but it is currently having problems because of technical issues in Azure. Am I correct? (the only disadvantage I see with this method is forcing a DNS look-up, which is bad for performance and could be avoided).

Now another possibility: creating a Virtual Network and joining the VMs. For this, would I have to delete the VMs, create the Virtual Network and then create two new VMs and associate them with the Virtual Network? Is this a trivial (non-time-consuming) thing to do? And what would all these operations imply in terms of financial costs and reconfiguration and keeping existing files (I don't want to totally reconfigure the VMs from scratch)?

Eagerly awaiting replies,

My best regards,

Miguel




Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>