linux 下, 查看 redis 是否启动:
 $ ps aux | grep redis-server
 # 查看 redis 服务是否在运行
 $ ps aux | grep redis</pre>
运行 redis
 $ ps aux | grep redis-server
停止 redis
$ redis-cli shutdown
出现问题:
1. 链接不上服务器 redis
代码报错
 nable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 服务器地址 :6379
解决方法:
- application.yml的redis配置中的spring.redis.timeout中连接超时时间(毫秒)中时间设置不能为0; 
- 
修改配置文件 - 找到 redis 的配置文件 redis.conf
 $ vim redis.conf- 修改 - protected-mode yes改为- protected-mode no
- 注释 - # bin 127.0.0.1
 
- 
检查代码中的 yml 文件 # REDIS (RedisProperties) # Redis数据库索引(默认为0) spring.redis.database=0 # Redis服务器地址 spring.redis.host=192.168.30.103 # Redis服务器连接端口 spring.redis.port=6379 # 连接池最大连接数(使用负值表示没有限制) spring.redis.jedis.pool.max-active=8 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.jedis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle=8 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle=0 # 连接超时时间(毫秒) spring.redis.timeout=5000</pre>