Jedis连接redis出错

Jedis连接redis出错

一:修改/usr/local/redis/bin目录下的redis.conf配置文件

Jedis连接redis出错

将绑定的127.0.0.1注释掉,保护模式设置为no

二:查看是否有多余的redis服务

[[email protected] bin]# ps -aux | grep redis
root 12921 0.2 0.2 186832 8360 ? Ssl 14:08 0:32 ./redis-server 127.0.0.1:6379
root 22059 0.0 0.0 112712 988 pts/0 S+ 17:15 0:00 grep --color=auto redis
[[email protected] bin]# kill -9 12921
[[email protected] bin]# ps -aux | grep redis
root 22099 0.0 0.0 112712 992 pts/0 S+ 17:15 0:00 grep --color=auto redis
[[email protected] bin]# ./redis-server redis.conf

查看redis状态

杀死127.0.0.1对应的redis服务