Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to...
错误原因是因为开启了保护模式,在配置文件redis.conf中找到daemonize=yes,改为daemonize=no即可。
在这时候我输入systemctl start redis又出现一个问题
进过网络查找得出解决方案如下:
进入这个目录下的文件:vi /etc/systemd/system/redis.service
删除Type=forking即可解决问题。
删掉后别忘了systemctl daemon-reload一下再开启redis。