一 安装
1 安装redis单例
操作系统:debian 12
1.1 在线安装
# 直接安装, 开机自启动
apt install redis-server
# 检查安装情况
systemctl status redis-server
systemctl start redis-server # 启动
systemctl stop redis-server # 停止
systemctl restart redis-server # 重启
# 检查是否已经设置开机自动启动
systemctl is-enabled redis-server
systemctl enable redis-server # 设置为开机自动启动
systemctl disable redis-server # 禁止开机自动启动
# 配置远程访问
vim /etc/redis/redis.conf
#a 注释
bind 127.0.0.1 ::1
#b 修改保护模式为no
protected-mode no
# 重新redis
systemctl restart redis-server
#在其他电脑上验证连通性
telnet xxx 6379
1.2 卸载
直接使用apt卸载
apt purge --auto-remove redis-server
手动删除redis命令和配置文件:
whereis redis-server
whereis redis-cli
rm /usr/bin/redis-*
rm -rf /etc/redis/
rm -rf /var/log/redis/
rm -rf /var/log/redis/
rm -rf /var/lib/redis/
rm /etc/init.d/redis-server
标签:运维,redis,server,rf,systemctl,rm,安装
From: https://www.cnblogs.com/binli33/p/18065750