General questions about Managed Service for Sharded PostgreSQL
Written by
Updated at December 22, 2025
How to fix the failed to get connection to any shard host within error when connecting to cluster hosts?
Error example:
failed to get connection to any shard host within: host {rc1d-cofs7cre********.mdb.yandexcloud.net:6432 rc1d}: dial tcp 10.151.25.35:6432: i/o timeout, host {rc1b-49796b52********.mdb.yandexcloud.net:6432 rc1b}: dial tcp 10.149.25.23:6432: i/o timeout, host {rc1a-kdm7v4qm********.mdb.yandexcloud.net:6432 rc1a}: dial tcp 10.148.25.15:6432: i/o timeout
This error occurs if the router cannot connect to the shard hosts.
Solution:
-
Make sure that the Managed Service for Sharded PostgreSQL cluster and shards are in the same network and security group.
-
Add to the security group the inbound and outbound traffic rules allowing TCP connection to port
6432:- Port range:
6432. - Protocol:
TCP. - Destination name:
CIDR. - CIDR blocks: Specify the cluster CIDR, e.g.,
10.96.0.0/16.
- Port range: