>_ IzzyLab

Hands-on task

This task is step 1 of the course “Redis in production”

RESP3: the HELLO handshake

easy~5 min

Redis is running on the default port. Connect to it over RESP3 and, from the server's reply to the handshake, find out the Redis version and the negotiated protocol version.

Write them to /root/hello.txt — exactly two lines:

  1. the server version (for example 8.0.2);
  2. the protocol number the client and server agreed on.
What you'll practise:
  • redis
  • RESP3
  • HELLO
  • redis-cli -3
  • protocol

Topic breakdown

RESP is the protocol clients use to talk to Redis. RESP2 knows only strings, integers, errors and arrays, so a map (for example, the reply to HGETALL) arrives as a flat list "key, value, key, value", and the client has to know how to assemble it. RESP3 (since Redis 6) adds typed replies: map, set, double, boolean, null, plus push messages, which client-side caching is built on. The protocol is chosen with HELLO 3 at the start of the connection; the same command returns information about the server (version, role, mode, modules). If the server doesn't know HELLO or protocol 3, the client stays on RESP2 — so when you upgrade client libraries it is worth checking what was actually negotiated.

What's checked

  1. first line is the server version
  2. second line is the RESP3 protocol
  3. a HELLO handshake happened

What it looks like