Redis 简明教程
Redis - Environment
在本章中,您将了解 Redis 的环境设置。
In this chapter, you will learn about the environmental setup for Redis.
Install Redis on Ubuntu
要在 Ubuntu 上安装 Redis,请转到终端并键入以下命令 −
To install Redis on Ubuntu, go to the terminal and type the following commands −
$sudo apt-get update
$sudo apt-get install redis-server
这将在您的计算机上安装 Redis。
This will install Redis on your machine.
Check If Redis is Working
$redis-cli
这将打开 redis 提示符。
This will open a redis prompt.
redis 127.0.0.1:6379>
在以上提示符中, 127.0.0.1 是您计算机的 IP 地址, 6379 是 Redis 服务器正在运行的端口。现在键入以下 PING 命令。
In the above prompt, 127.0.0.1 is your machine’s IP address and 6379 is the port on which Redis server is running. Now type the following PING command.
redis 127.0.0.1:6379> ping
PONG
这表明 Redis 已成功安装在您的计算机上。
This shows that Redis is successfully installed on your machine.
Install Redis Desktop Manager on Ubuntu
要在 Ubuntu 上安装 Redis 桌面管理器,只需从 https://redisdesktop.com/download 下载该软件包
To install Redis desktop manager on Ubuntu, just download the package from https://redisdesktop.com/download
打开下载的软件包并安装它。
Open the downloaded package and install it.
Redis 桌面管理器将为您提供 UI 来管理您的 Redis 键和数据。
Redis desktop manager will give you UI to manage your Redis keys and data.