- Created 2 Ubuntu VMs in same availability Set, region, virtual network with apache2 installed.
- Renamed the index.html of both the VMs to: "This is VM1", "This is VM2".
- Created Internal Load Balancer with the below Configuration:
- Front End IP Configuration: Same VNet, Dynamic Assignment, Zone-Redundant as Availability Zone
- Back End Pool: Selected 2 VMs on the bepool
- Health Probe: TCP Protocol, Port 80
- Load Balancing Rule: TCP - 443 Port, Selected the created bepool and health probe, TCP Reset - Enabled, Idle Time out - 4 minutes
- Inbound NAT Rules - Same as LB Rule but the port is 80.
The Problem is: When I copy the Front End IP of the Load Balancer and pasting in the browser, it is not showing any output like:
On VM Side, I have enabled the ports 80, 443, and 22 in the NSG for both of the VMs.
If that output comes, then I can hit the refresh page many times to see the load is distributing between the two VMs that shows "This is VM1" from VM2.
CodePudding user response:
I tried to reproduce the same in my environment and got the results like below:
I have created a virtual machine with:
- VM 1 as availability zone
zone 1
with Inbound port asHTTP(80) and SSH (22)
- VM 2 as availability zone
zone 2
with inbound port asHTTP(80) and SSH (22)
Then I have installed Apache web server Renamed the index.html for both vm like below:
Vm1
VM2
Created a load balancer type select as public
in frontend ip created new public ip:
Added two virtual machines in backend pool and Add health probe. After creating load balancer verify public Ip address are same assigned in your both virtual machine.
Then add Load balancer rule port 80 like below:
Now, when I copy the Frontend IP of the Load Balancer and pasting in the browser I got result successfully like below:
Sometimes if we refresh, we can't redirect to another server keep being active on the server open another tab refresh it it will redirect multiple vm
Update
I have created two ubuntu vm with availability set on same region and vnet of Apache installed.
Then created with Internal Load Balancer:
Then added same Front End IP -> Back End Pool -> Health Probe -> And Load Balancing Rule TCP as 80 port
According to MSDocs
If your application hosted in the backend VM of an internal load balancer is trying to access another application hosted in the same backend VM over the same network interface, it's an unsupported scenario and will fail.
You need to create another test virtual machine with windows server to access RDP with same virtual network or while peering vnet you can access it while peering Basic LB has some limitations over Vnet peering
I have created another Vm and connected to remote desktop here, when I try to access Front end IP of the Load Balancer, I got result successfully like below.