Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • 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
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
    • Architecture and protection of a basic internet service
    • Cost analysis by resource using Object Storage
      • Configuring a fault-tolerant architecture in Yandex Cloud
        • Overview
        • Management console
        • Terraform
      • Integrating an L7 load balancer with Cloud CDN and Object Storage
      • Autoscaling an instance group to process messages enqueued in Message Queue
      • Updating an instance group under load
      • Creating a budget trigger that invokes a function to stop a VM
      • Deploying a fault-tolerant architecture with preemptible VMs
      • Creating triggers that invoke a function to stop a VM and send a Telegram notification

In this article:

  • Prepare your cloud environment
  • Required paid resources
  • Prepare the environment
  • Create an instance group
  • Upload the website files
  • Create a network load balancer
  • Run a fault tolerance test
  • How to delete the resources you created
  1. Basic infrastructure
  2. Fault tolerance and scaling
  3. Fault-tolerant website with load balancing via an Network Load Balancer
  4. Management console

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

Written by
Yandex Cloud
Updated at May 7, 2025
  • Prepare your cloud environment
    • Required paid resources
    • Prepare the environment
  • Create an instance group
  • Upload the website files
  • Create a network load balancer
  • Run a fault tolerance test
  • How to delete the resources you created

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

  1. Prepare your cloud environment.
  2. Create an instance group.
  3. Upload the website files.
  4. Create a network load balancer.
  5. Run a fault tolerance test.

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

Prepare your cloud environmentPrepare your cloud environment

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).

Prepare the environmentPrepare the 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 nlb-network cloud network and its subnets.
      • In the Public address field, select Auto.
    5. Under Access, specify the data for accessing the instance:

      • In the Service account field, select the service account to link to the VM.
      • Enter 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 that the load balancer will use to receive traffic, attach the target group created together with the instance group, and configure resource health checks in it.

Management console
  1. In the management console, select the folder to create a load balancer in.

  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 parameters:

      • 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 created earlier. If there is only one target group, it is selected automatically.

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

      • Name: health-check-1
      • Healthy threshold: Number of successful checks to consider the VM ready to receive traffic: 5
      • Unhealthy threshold: Number of failed checks to stop routing traffic to the VM: 5
    3. Click Apply.

  6. Click Create.

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

Run a fault tolerance testRun a fault tolerance test

  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 created resources:

  1. Delete the network load balancer.
  2. Delete the instance group.
  3. Delete the static public IP 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.