Getting started with Managed Service for Redis
To get started with the service:
Before you start
Go to the management console. Then log in to Yandex.Cloud or sign up if you don't have an account yet.
If you don't have a folder yet, create one:
Click Create folder in the Home page of the management console.
Enter the folder name.
- Length — from 3 to 63 characters.
- The name may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter. The last character can't be a hyphen.
Select Create a default network. A network is created with subnets in each availability zone.
You can only connect to the cluster from within Yandex.Cloud. To do this, create a Linux VM in the same network as the cluster.
Connect to the VM via SSH.
Install the redis-cli utility on the VM. For example, like this (for Ubuntu 20.04 LTS):
sudo apt install redis-tools
Create a cluster
- In the management console, select the folder where you want to create a cluster Redis.
- Select Yandex Managed Service for Redis.
- Click Create cluster.
- Set the cluster parameters and click Create cluster. This process is described in detail in Creating Redis clusters.
- Wait until the cluster is ready: its status on the Managed Service for Redis dashboard changes to
Runningand its state to
Alive. This may take some time.
Connect to the cluster
Connect to the Redis cluster master host using
To view an example of the command with the host FQDN filled in, open the cluster page in the management console and click Connect.
To the master via any cluster host using Sentinel:
Get the address of the master host by using Sentinel and any Redis host:
redis-cli -h <FQDN of any Redis host> -p 26379 sentinel get-master-addr-by-name <Redis cluster name> | head -n 1
Connect to the host with this address:
redis-cli -c -h <Redis master host address> -a <Redis password>
Directly to the master host:
redis-cli -c -h <FQDN of Redis master host> -p 6379 -a <password for Redis>
Once connected, send the
PINGcommand. Redis should return