Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Network Load Balancer
  • Getting started
    • All tutorials
    • Architecture and protection of a basic internet service
    • Implementing fault-tolerant scenarios for NAT VMs
    • Configuring a fault-tolerant architecture in Yandex Cloud
      • Overview
      • Management console
      • Terraform
    • Updating an instance group under load
    • Integrating Cloud DNS and a corporate DNS service
    • Connecting to Object Storage from Virtual Private Cloud
    • Connecting to Container Registry from Virtual Private Cloud
    • Implementing a secure high-availability network infrastructure with a dedicated DMZ based on the Check Point NGFW
    • Deploying Microsoft Exchange
    • Deploying an Always On availability group with an internal network load balancer
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Get your cloud ready
  • Required paid resources
  • Set up your environment
  • Create an instance group
  • Upload the website files
  • Create a network load balancer
  • Test the fault tolerance
  • How to delete the resources you created
  1. Tutorials
  2. Fault-tolerant website with load balancing via a Network Load Balancer
  3. Management console

Fault-tolerant website with load balancing via Yandex Network Load Balancer using the management console

Written by
Yandex Cloud
Updated at June 26, 2025
  • Get your cloud ready
    • Required paid resources
    • Set up your environment
  • Create an instance group
  • Upload the website files
  • Create a network load balancer
  • Test the fault tolerance
  • How to delete the resources you created

To create a fault-tolerant website with load balancing via Yandex Network Load Balancer using the Yandex Cloud management console:

  1. Get your cloud ready.
  2. Create an instance group.
  3. Upload the website files.
  4. Create a network load balancer.
  5. Test the fault tolerance.

If you no longer need the resources you created, delete them.

Get your cloud readyGet your cloud ready

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Required paid resourcesRequired paid resources

The website support cost includes:

  • Fee for disks and continuously running VMs (see Yandex Compute Cloud pricing).
  • Fee for using dynamic or static public IP addresses (see Yandex Virtual Private Cloud pricing).
  • Fee for a network load balancer and traffic balancing (see Network Load Balancer pricing).

Set up your environmentSet up your environment

  • Create a cloud network named nlb-network and subnets.
  • Create a service account named nlb-sa and assign the editor role to it.
  • Create an SSH key pair.

Create an instance groupCreate an instance group

Management console
  1. In the management console, select Compute Cloud.

  2. In the left-hand panel, select Instance groups and click Create group of virtual machines.

  3. Under Basic parameters:

    • Enter a name for the instance group, e.g., nlb-vm-group.
    • Select the nlb-sa service account.
  4. Under Allocation, select the ru-central1-a and ru-central1-b availability zones to ensure fault tolerance of your hosting.

  5. Under Instance template, click Define to configure a basic instance:

    1. Under Boot disk image, open the Marketplace tab and click Show all Marketplace products. Choose a product:

      • LEMP for Linux, Nginx, MySQL®, and PHP
      • LAMP for Linux, Apache, MySQL®, and PHP

      Click Use.

    2. Under Disks and file storages, specify:

      • Type: HDD
      • Size: 3 GB
    3. Under Computing resources, open the Custom tab and specify the following:

      • Platform: Intel Ice Lake
      • vCPU: 2
      • Guaranteed vCPU performance: 20%
      • RAM: 1 GB
    4. Under Network settings:

      • Select the cloud network named nlb-network and its subnets.
      • In the Public address field, select Auto.
    5. Under Access, specify the VM access credentials:

      • In the Service account field, select the service account to link to the VM.
      • Specify the username in the Login field.
      • In the SSH key field, paste the contents of the public key file.
    6. Click Save.

  6. Under Scaling, specify the instance group size: 2.

  7. Under Integration with Network Load Balancer, select Create target group and enter nlb-tg as the group name.

  8. Click Create.

It may take a few minutes to create an instance group. As soon as all VMs change their status to RUNNING, you can upload the website files to them.

Upload the website filesUpload the website files

To test the web server, upload the website files to each VM. You can use the index.html file from this archive as an example.

For each VM in the created group, do the following:

  1. Get the VM public IP address.

  2. Connect to the VM via SSH.

  3. Grant your user write permissions for the /var/www/html directory:

    sudo chown -R "$USER":www-data /var/www/html
    
  4. Upload the website files to the VM via SCP.

    Linux/macOS
    Windows

    Use the scp command line utility:

    scp -r <path_to_directory_with_files> <VM_user_name>@<VM_IP_address>:/var/www/html
    

    Use WinSCP to copy the local file directory to /var/www/html on the VM.

Create a network load balancerCreate a network load balancer

When creating a network load balancer, you need to add a listener to handle incoming traffic, attach the target group created along with the instance group, and configure health checks for its targets.

Management console
  1. In the management console, select the folder where you need to create a load balancer.

  2. In the list of services, select Network Load Balancer and click Create a network load balancer.

  3. Enter a name for the load balancer, e.g., nlb-1.

  4. Under Listeners:

    1. Click Add listener and specify the following settings:

      • Name: nlb-listener
      • Port: 80
      • Target port: 80
    2. Click Add.

  5. Under Target groups:

    1. Click Add target group and select the nlb-tg target group you created earlier. If there is only one target group, it will be selected automatically.

    2. Under Health check, click Configure and specify the following:

      • Name: health-check-1.
      • Healthy threshold: 5. This stands for the number of successful checks required to consider the VM ready to receive traffic.
      • Unhealthy threshold: 5. This stands for the number of failed checks before traffic is no longer routed to the VM.
    3. Click Apply.

  6. Click Create.

After you create a network load balancer, test the fault tolerance.

Test the fault toleranceTest the fault tolerance

  1. Get the public IP address of any VM from the group you created.

  2. Connect to the VM via SSH.

  3. Stop the web service to simulate a failure on the web server:

    LAMP
    LEMP
    sudo service apache2 stop
    
    sudo service nginx stop
    
  4. Get the listener IP address.

  5. Open the website in the browser using the listener address.

    The connection should be successful, even though one of the web servers has failed.

  6. When the check is complete, start the web service again:

    LAMP
    LEMP
    sudo service apache2 start
    
    sudo service nginx start
    

How to delete the resources you createdHow to delete the resources you created

To shut down the hosting and stop paying for the resources you created:

  1. Delete the network load balancer.
  2. Delete the instance group.
  3. Delete the static public IP address if you reserved one.

See alsoSee also

  • Fault-tolerant website with load balancing via Yandex Network Load Balancer using Terraform

Was the article helpful?

Previous
Overview
Next
Terraform
© 2025 Direct Cursus Technology L.L.C.