首页 > 代码库 > Could not connect to Redis at 192.168.0.129:6379: Connection refused

Could not connect to Redis at 192.168.0.129:6379: Connection refused

在虚拟机上(CentOS 6.7)本机连接自己的redis

[root@localhost bin]# ./redis-cli -h 192.168.0.129 -p 6379
Could not connect to Redis at 192.168.0.129:6379: Connection refused
Could not connect to Redis at 192.168.0.129:6379: Connection refused
not connected> 

查看配置文件,发现bind是写成:

bind 127.0.0.1

修改配置为

bind 127.0.0.1 192.168.0.129
192.168.0.129是redis所在的服务器的地址

 

Could not connect to Redis at 192.168.0.129:6379: Connection refused