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 for business
    • 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
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Data Processing
  • Getting started
    • All tutorials
      • Configuring a network for Yandex Data Processing
      • Migrating an HDFS cluster to a different availability zone
      • Network connection switching during Yandex Data Processing cluster recreation
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • FAQ

In this article:

  • Required paid resources
  • Getting started
  • Create a DNS zone and CNAME record
  • Delete the cluster and recreate it
  • Delete the resources you created
  1. Tutorials
  2. Cluster network settings and maintenance
  3. Network connection switching during Yandex Data Processing cluster recreation

Reconfiguring a network connection when recreating a Yandex Data Processing cluster

Written by
Yandex Cloud
Updated at September 25, 2025
  • Required paid resources
  • Getting started
  • Create a DNS zone and CNAME record
  • Delete the cluster and recreate it
  • Delete the resources you created

You may need to recreate a cluster to install software updates, transfer the load across clusters, move clusters from one availability zone to another, or perform other operations.

This tutorial describes how to set up DNS to quickly switch network traffic over to new host FQDNs when recreating a Yandex Data Processing cluster. For the current name of the cluster master host, a network alias (CNAME record) is created in Yandex Cloud DNS. When you recreate the cluster, the CNAME record changes to the master host's new name.

To set up DNS for your Yandex Data Processing cluster:

  1. Create a DNS zone and CNAME record.
  2. Delete the cluster and recreate it.

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

Required paid resourcesRequired paid resources

The support cost includes:

  • Fee for a Yandex Data Processing cluster (see Yandex Data Processing pricing).
  • Fee for a NAT gateway (see Virtual Private Cloud pricing).
  • Fee for an Object Storage bucket: data storage and operations with it (see Object Storage pricing).
  • Fee for using public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).

Getting startedGetting started

Set up the infrastructure:

Manually
Terraform
  1. Create a network named data-proc-network with the Create subnets option disabled.

  2. In data-proc-network, create a subnet with the following settings:

    • Name: data-proc-subnet-a
    • Availability zone: ru-central1-a
    • CIDR: 192.168.1.0/24
  3. Create a NAT gateway and a route table named data-proc-route-table in data-proc-network. Associate the table with data-proc-subnet-a.

  4. In data-proc-network, create a security group named data-proc-security-group with the following rules:

    • One rule for incoming and another one for outgoing service traffic:

      • Port range: 0-65535
      • Protocol: Any
      • Source/Destination name: Security group
      • Security group: Current
    • Rule for outgoing HTTPS traffic:

      • Port range: 443
      • Protocol: TCP
      • Destination name: CIDR
      • CIDR blocks: 0.0.0.0/0
  5. Create a service account named data-proc-sa with the following roles:

    • dataproc.agent
    • dataproc.provisioner
    • storage.uploader
    • storage.viewer
  6. Create a Yandex Object Storage bucket with restricted access.

  7. Create a Yandex Data Processing cluster in any suitable configuration with the following settings:

    • Environment: PRODUCTION.
    • Service account: data-proc-sa.
    • Bucket ID format: List.
    • Bucket name: Select the bucket you created earlier.
    • Network: data-proc-network.
    • Security groups: data-proc-security-group.
  1. If you do not have Terraform yet, set up and configure it.

  2. Download the file with provider settings. Place it in a separate working directory and specify the parameter values.

  3. Download the data-proc-dns-connect.tf configuration file to the same working directory.

    This file describes:

    • Network.
    • Subnet.
    • DNS zone and CNAME record for the cluster master host.
    • NAT gateway and route table.
    • Security groups.
    • Service account for operations with cloud resources.
    • Service account for bucket management.
    • Static access key required to grant the service account permissions for the bucket.
    • Bucket to store job dependencies and results.
    • Yandex Data Processing cluster.
  4. In the data-proc-dns-connect.tf file, specify these variables:

    • folder_id: Folder ID.
    • path_to_ssh_public_key: Path to the public SSH key.
    • os_sa_name: Name of the service account for bucket management.
    • bucket: Bucket name.
  5. Run the terraform init command in the working directory with the configuration files. This command initializes the provider specified in the configuration files and enables you to use its resources and data sources.

  6. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    Terraform will display any configuration errors detected in your files.

  7. Create the required infrastructure:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

Create a DNS zone and CNAME recordCreate a DNS zone and CNAME record

Create the resources:

Manually
Terraform
  1. Create an internal DNS zone with the following settings:

    • Zone: data-proc-test-user.org..
    • Networks: Select data-proc-network.
    • Name: dp-private-zone.
  2. Create a DNS record of the CNAME type with the following settings:

    • Name: data-proc-test-user.org..
    • Data: FQDN of the Yandex Data Processing cluster master host.
  1. Get the FQDN of the Yandex Data Processing cluster master host.

  2. In the data-proc-dns-connect.tf file, specify this variable:

    • dataproc_fqdn: FQDN of the Yandex Data Processing cluster master host.
  3. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    Terraform will display any configuration errors detected in your files.

  4. Create the required infrastructure:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

Test network access to the cluster by the CNAME record:

dig data-proc-test-user.org.
<...>
;; ANSWER SECTION:
data-proc-test-user.org. 600	IN	CNAME	rc1a-dataproc-m-6ijqng07vul2mu8j.mdb.yandexcloud.net.
rc1a-dataproc-m-6ijqng07vul2mu8j.mdb.yandexcloud.net. 600 IN A 192.168.1.8

Delete the cluster and recreate itDelete the cluster and recreate it

Manually
Terraform
  1. Delete the Yandex Data Processing cluster and create a new one with identical settings.
  2. Change the DNS record you created earlier and specify the FQDN of the master host of the new cluster in the Data parameter.
  1. Delete the yandex_dataproc_cluster section in data-proc-dns-connect.tf.

  2. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    If there are any errors in the configuration files, Terraform will point them out.

  3. Apply the changes:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

  4. Add the yandex_dataproc_cluster section to data-proc-dns-connect.tf, with the same contents as in the source file, to create a new Yandex Data Processing cluster.

  5. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    If there are any errors in the configuration files, Terraform will point them out.

  6. Create your cluster:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

  7. Get the FQDN of the master host of the new Yandex Data Processing cluster.

  8. In the data-proc-dns-connect.tf file, specify this variable:

    • dataproc_fqdn: FQDN of the cluster master host.
  9. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    If there are any errors in the configuration files, Terraform will point them out.

  10. Apply the changes:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

Make sure you still have network access to the cluster by the CNAME record:

dig data-proc-test-user.org.
<...>
;; ANSWER SECTION:
data-proc-test-user.org. 600	IN	CNAME	rc1a-dataproc-m-lsqohjh53rfu659d.mdb.yandexcloud.net.
rc1a-dataproc-m-8kompl81232cdsu8j.mdb.yandexcloud.net. 600 IN A 192.168.1.8

Delete the resources you createdDelete the resources you created

Some resources incur charges. To avoid unnecessary expenses, delete the resources you no longer need:

Manually
Terraform
  1. Delete the Yandex Data Processing cluster.
  2. If you reserved public static IP addresses, release and delete them.
  3. Delete the subnet.
  4. Delete the route table.
  5. Delete the NAT gateway.
  6. Delete the network.
  7. Delete the DNS zone.
  1. In the terminal window, go to the directory containing the infrastructure plan.

    Warning

    Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

  2. Delete resources:

    1. Run this command:

      terraform destroy
      
    2. Confirm deleting the resources and wait for the operation to complete.

    All the resources described in the Terraform manifests will be deleted.

Was the article helpful?

Previous
Migrating an HDFS cluster to a different availability zone
Next
Overview
© 2025 Direct Cursus Technology L.L.C.