在Ubuntu上安装Redis非常简单,执行下面这两行命令即可:
sudo apt update
sudo apt install redis-server
一旦安装完成,Redis 服务将会自动启动。若要检查服务的状态:
sudo systemctl status redis-server
出现以下内容表示安装启动成功:
redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor >
Active: active (running) since Thu 2023-08-24 11:04:10 CST; 41min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 4860 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=e>
Main PID: 4862 (redis-server)
Tasks: 4 (limit: 4561)
Memory: 1.9M
CGroup: /system.slice/redis-server.service
└─4862 /usr/bin/redis-server 127.0.0.1:6379