Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for PostgreSQL
  • Getting started
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
    • General questions
    • Connection
    • Updating a cluster
    • Cluster configuration
    • Moving and restoring a cluster
    • Users and roles
    • High availability and load balancing
    • Monitoring and logs
    • Error messages
    • All questions on one page
  1. FAQ
  2. High availability and load balancing

High availability and load balancing

Written by
Yandex Cloud
Updated at December 25, 2025
  • How to remove a host from the master selection process?

  • Why do I get an error when setting up cascading replication?

  • How to ensure I am always connecting to the master host?

  • How to ensure I am always connecting to the most up-to-date replica?

  • Why did the master and replicas swap roles?

  • Can I configure multi-master within a single cluster or between two clusters?

  • How to configure load balancing so that all read requests are redirected to replicas?

  • When does automatic failover occur?

How to remove a host from the master selection process?How to remove a host from the master selection process?

You can exclude a host from the master selection process during an automatic or manual failover. To do this, set up cascading replication by specifying a replication source for the host you want to exclude.

Warning

To ensure high availability during maintenance, your cluster must have at least one replica without a replication source.

Why do I get an error when setting up cascading replication?Why do I get an error when setting up cascading replication?

Error message:

cluster should have at least 2 HA hosts to use cascade host

This error occurs if you specify a replication source for the only non-cascading replica.

To ensure high availability, your cluster must have at least one replica without a replication source. This replica will be promoted to master if the master host fails during maintenance.

To learn more about replication, see this article.

How to ensure I am always connecting to the master host?How to ensure I am always connecting to the master host?

To connect to the current master host, use a special FQDN in the c-<cluster_ID>.rw.mdb.yandexcloud.net format. This FQDN supports read and write access.

Example command for connecting to the master host
psql "host=c-<cluster_ID>.rw.mdb.yandexcloud.net \
      port=6432 \
      sslmode=verify-full \
      dbname=<DB_name> \
      user=<username>"

How to ensure I am always connecting to the most up-to-date replica?How to ensure I am always connecting to the most up-to-date replica?

To connect to the most up-to-date replica, use a special FQDN in the c-<cluster_ID>.ro.mdb.yandexcloud.net format. This FQDN only supports read access.

Example command for connecting to a replica
psql "host=c-<cluster_ID>.ro.mdb.yandexcloud.net \
      port=6432 \
      sslmode=verify-full \
      dbname=<DB_name> \
      user=<username>"

If there are no active replicas in the cluster, this FQDN will point to the current master host.

Why did the master and replicas swap roles?Why did the master and replicas swap roles?

This means the master has failed over to the replica. Automatic master failover guarantees cluster availability during maintenance or in the event of the master host failure.

To connect to the current master host, use a special FQDN.

Warning

Use master host special FQDN-based connections only for processes that can cope with database being unavailable for writing for up to 10 minutes.

Can I configure multi-master within a single cluster or between two clusters?Can I configure multi-master within a single cluster or between two clusters?

No, Managed Service for PostgreSQL does not support multi-master configuration.

For more details on high availability cluster configuration, see High availability managed databases (MDB).

How to configure load balancing so that all read requests are redirected to replicas?How to configure load balancing so that all read requests are redirected to replicas?

As Managed Service for PostgreSQL does not provide load balancing, you need to configure it in your application backend. To send read requests to replicas, your application must first identify the master and replica hosts, e.g., by using libpq. For more information, see this PostgreSQL article.

Alternatively, use a special FQDN pointing to the most up-to-date replica.

For more information, see High availability.

When does automatic failover occur?When does automatic failover occur?

The master host can automatically fail over to another host:

  • During cluster updates.
  • On master host failure.
  • Upon cluster recovery.
  • During maintenance.

Master failover ensures the cluster works correctly under the listed conditions.

Note

To ensure high availability, the cluster always has at least one replica without an explicitly defined replication source. This replica can take over as master when needed.

Was the article helpful?

Previous
Users and roles
Next
Monitoring and logs
© 2026 Direct Cursus Technology L.L.C.