Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect 2 virtual machines in Windows Azure to have Two-Tier-Architecture?

How to create 2 connected virtual machines in Windows Azure to be able to deploy Two-Tier-Architecture solution ?

Let me clarify the scenario, Currently I am using 1 virtual machines in Windows Azure where I have the SQL Server 2008 DB installed AND the ASP.NET solution.

However, I want to create a very simple Two-Tier-Architecture where the SQL Server 2008 DB is installed on Server1, and the ASP.NET solution is deployed on Server2.

So, How to accomplish that? I mean, How to connected those two separate virtual machines? And how they can work together to run one single solution?

Could you please help me out in this scenario ?

Thanks !

like image 923
Alex Avatar asked Feb 03 '14 11:02

Alex


People also ask

How do I connect two virtual machines to another host?

You just need to forward the ports that you want (which you can do in VirtualBox's network settings), then connect to the IP of one host from the other host's VM. As @TJJ said, your other option is to used bridged networking instead of NAT, which would let the computers connect with no extra configuration.

Which two ways can be used to connect virtual network subnets in two different regions each is a complete solution choose only two?

Route via the Internet. VNet peering. Site-to-site VPN.


1 Answers

Seems like a lot of attention being given to Virtual Networks. That's fine, but... if all you're trying to do is create a multi-tier app with a handful of VMs working in conjunction with each other, you can simply create multiple VMs within the same cloud service (that is, they all live in xyz.cloudapp.net).

They'll all sit behind a single public IP address, but consider your case where you have a web server and a database server:

  • Expose ports 80 and 443 specifically for the web server(s) (you can have multiple, and load-balance the ports across these VMs
  • Don't expose any public ports for the database server

Once deployed to the same cloud service, each VM in the cloud service can talk directly to any other VM in the cloud service, using the host name you assigned to it.

You can also deploy your web and database tiers to different cloud services, and still communicate between them without a Virtual Network. If you open, say, port 1433 on your database server, now your web tier can simply open a connection to yourdb.cloudapp.net:1433. Of course, this means the entire world can do the same, but... you can apply an endpoint ACL (access control list) on yourdb.cloudapp.net port 1433, and allow only the public VIP of your web tier's cloud service.

You'd need a Virtual Network if your web and database tiers are in separate cloud services and you don't want any exposed ports on your data tier, and you don't want to go through the built-in load balancer.

like image 174
David Makogon Avatar answered Oct 13 '22 23:10

David Makogon