Conteúdo do Curso
Introduction to Redis
Introduction to Redis
Connecting to and Starting Redis
Starting Redis Server
You already know how to start the server via the command line on macOS.
After running the command, you'll see information about the current server status.
When Redis starts, it logs key information, including the version (7.2.6
), port number (typically 6379
), and the PID (Process ID), which uniquely identifies the Redis process for management purposes.
It also logs the operating mode (default is standalone mode
). The message Ready to accept connections
confirms that the server has started successfully and is ready to handle requests.
Working with Redis CLI
To connect to the Redis server, run the following command:
Once connected, you'll see the command prompt:
Here, you can enter your commands that will interact with the Redis server. We'll cover that in the next section. But first, let's check if the server is working and if everything is set up correctly.
Checking Server Status
To check the server's status, type the following command in Redis CLI:
When you enter this command, the server responds with PONG
, indicating that the connection is established and the server is running correctly.
Disconnecting from the Server
To quit Redis CLI, type the following command:
This will close the connection and exit the command line interface.
1. What command is used to start the Redis server?
2. Which command is used to exit the Redis CLI
?
Obrigado pelo seu feedback!