Getting started with Yandex Managed Service for Valkey™
To get started with the service:
Getting started
-
Go to the management console
and log in to Yandex Cloud or sign up if not signed up yet. -
If you do not have a folder yet, create one:
-
In the management console
, select the appropriate cloud from the list on the left. -
At the top right, click Create folder.
-
Enter the folder name. The naming requirements are as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
(Optional) Enter a description of the folder.
-
Select Create a default network. This will create a network with subnets in each availability zone. Within this network, a default security group will be created, inside which all network traffic is allowed.
-
Click Create.
-
-
Make sure your account has the vpc.user role and the managed-redis.editor role or higher for creating a cluster.
-
Specify the following parameters:
-
Boot disk image:
Ubuntu 24.04
from Marketplace. -
Public IP:
Auto
. -
Security groups: Leave the field empty.
The VM will be assigned the default security group with the
default-sg
prefix. This security group enables SSH connections to the VM and allows any outgoing traffic.
Set the other parameters as you need.
-
-
Create a security group in the same network as the VM. This security group will be assigned to the Valkey™ cluster when creating it.
In the security group, add a rule that allows connections to a non-sharded Valkey™ cluster. Configuire the rule to allow incoming traffic from the default security group assigned to the VM.
Create a cluster
Create a non-sharded Valkey™ cluster without public access. You can only connect to such a cluster from a VM in the cluster network.
To create a cluster:
-
In the management console, select the folder where you want to create a Valkey™ cluster.
-
Select Yandex Managed Service for Valkey™.
-
Click Create cluster.
-
Specify the following cluster parameters:
-
Basic parameters:
- Cluster name: Cluster name. It must be unique within the folder.
- Cluster sharding: Keep this option disabled.
- Enable TLS support.
- Enable Use FQDN instead of IP addresses.
-
Network settings:
- Network: Specify the network with the previously created VM.
- Security groups: Specify the previously created security group for the cluster.
-
Hosts → Public access: Make sure to disable this option, i.e., set its value to
No
, for all cluster hosts. -
DBMS settings → Password: User password.
The password must be between 8 and 128 characters long. The password must meet the
[a-zA-Z0-9@=+?*.,!&#$^<>_-]*
regular expression.
-
-
Click Create cluster.
-
Wait until the cluster is ready: its status on the Yandex Managed Service for Valkey™ dashboard will change to Running and its state, to Alive. This may take some time.
For more information about creating a cluster, see Creating a Valkey™ cluster.
Connect to the cluster
-
Install the
redis-cli
utility:sudo apt update && sudo apt install --yes redis-tools
-
Connect directly to the master host:
Connecting without SSLConnecting via SSLredis-cli -h c-<cluster_ID>.rw.mdb.yandexcloud.net \ -p 6379 \ -a <Valkey™_password>
-
Get an SSL certificate:
mkdir -p ~/.redis && \ wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" \ --output-document ~/.redis/YandexInternalRootCA.crt && \ chmod 0655 ~/.redis/YandexInternalRootCA.crt
The certificate will be saved to the
~/.redis/YandexInternalRootCA.crt
file. -
Run this command:
redis-cli -h c-<cluster_ID>.rw.mdb.yandexcloud.net \ -p 6380 \ -a <Valkey™_password> \ --tls \ --cacert ~/.redis/YandexInternalRootCA.crt
You can get the cluster ID with a list of clusters in the folder.
To see code examples with the host FQDN filled in, open the cluster page in the management console
and click Connect. -
-
Once connected, send the
PING
command. Valkey™ should respond withPONG
.
What's next
- Read about service concepts.
- Learn more about creating a cluster and connecting to a cluster.
- Read questions and answers.