安装redis数据库
yum install redis
redis服务命令
# 启动redis
service redis start
# 停止redis
service redis stop
# 查看redis运行状态
service redis status
# 查看redis进程
ps -ef | grep redis
# 重启redis
service redis restart
设置redis为开机自动启动
chkconfig redis on
进入redis服务
redis-cli
#查看所有key值
keys *
#清空整个 Redis 服务器的数据
flushall
#清空当前库中的所有 key
flushdb
查看配置文件
vi /etc/redis.conf
解除只能本机访问限制
(telnet配置)
找到redis.conf
注释以下绑定的主机地址
# bind 127.0.0.1
## 关闭守护进程
daemonize no
## 关闭保护模式
protected-mode no
保存redis.conf
## 查看redis进程状态
ps -ef | grep redis
运行cmd telnet ip 端口尝试连接
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
导致原因: 可能磁盘空间不足