FQDNs of Valkey™ hosts
To connect to a host, you need its fully qualified domain name (FQDN). You can get it using one of the following methods:
-
In the management console
, copy the cluster connection command (it contains the host’s FQDN). To get the command, go to the cluster page and click Connect. -
Look up the FQDN in the management console:
- Navigate to the cluster page.
- Navigate to Hosts.
- Copy the Host FQDN column value.
You can also use the following FQDNs to connect:
- Special FQDN: Only to a non-sharded cluster.
- Stable FQDNs: To any cluster.
Special FQDN
Yandex Managed Service for Valkey™ provides a special FQDN that can be used instead of regular host FQDNs to connect to non-sharded clusters.
In a non-sharded cluster, an FQDN of c-<cluster_ID>.rw.mdb.yandexcloud.net format always points to the current master host. You can get the cluster ID with the list of clusters in the folder. When connecting to this FQDN, you can perform read and write operations.
In multi-host clusters, a special FQDN may temporarily point to a replica host (for up to 10 minutes). This is because it takes time to update DNS records for special FQDNs. If your write request returns an error, repeat it later.
Warning
If automatic failover promotes a host without public access to master, you will not be able to connect to that host from the internet. To avoid this, enable public access for all cluster hosts.
Here is an example of an SSL-encrypted connection to a master host for a cluster with the c9qash3nb1v9******** ID:
redis-cli -h c-c9qash3nb1v9********.rw.mdb.yandexcloud.net \
-p 6380 \
--tls \
--cacert ~/.redis/YandexInternalRootCA.crt \
-a <Valkey™_password>
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.
Stable FQDNs
For Yandex Managed Service for Valkey™, stable FQDNs are available that always point to live hosts in different availability zones:
c-<cluster_ID>-valkey0.mdb.yandexcloud.netc-<cluster_ID>-valkey1.mdb.yandexcloud.netc-<cluster_ID>-valkey2.mdb.yandexcloud.net
You can request the cluster ID with the list of clusters in the folder.
You can use these FQDNs for connection to hosts in either a sharded or non-sharded cluster alongside special FQDNs and regular host FQDNs.
If the cluster hosts reside in one or two availability zones, or there are less than three hosts, stable FQDNs can point to the same host. The target host can be either a master or a replica. After connecting, request information:
-
On master hosts:
- In a non-sharded cluster, via the
INFOcommand. - In a sharded cluster, via the
CLUSTER INFOcommand.
- In a non-sharded cluster, via the
-
On shards in a sharded cluster, via the
CLUSTER SHARDScommand.
When connecting to stable FQDNs, read and write operations are allowed.
Here is an example of an SSL-encrypted connection to a cluster host with the c9qash3nb1v9******** ID:
redis-cli -h c-c9qash3nb1v9********-valkey1.mdb.yandexcloud.net \
-p 6380 \
--tls \
--cacert ~/.redis/YandexInternalRootCA.crt \
-a <Valkey™_password>