https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-linux/ 安装文档
查看可用版本
apt-cache madison redis
安装
sudo apt update
sudo apt install redis-server
redis-server --version 查看版本
sudo systemctl status redis-server #检查运行状态
sudo systemctl start redis-server #启动
sudo systemctl stop redis-server #停止
sudo systemctl restart redis-server #重启
使用官方源安装最新版本
bash
sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
redis-cli INFO | grep redis_version 查看版本
开启外网访问
配置文件:
/etc/redis/redis.conf
修改bind的值为0.0.0.0 ::1 监听所有端口
只安装redis-cli而不安装redis服务
sudo apt install redis-tools
python包
uv pip install redis
Navicat Premium Lite 17 发布订阅事件
PUBLISH crowdpulse:events:HOTSPOT_DETECTED {"type":"HOTSPOT_DETECTED","data":{"title":"商务部回应美胁迫他国限制对华经贸……","content":"商务部回应美胁迫他国限制对华进行经济制裁","source":"zhihu","url":"https://…","keywords":["政治","科技","经济"]}}