連接不到redis Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.43.52:6379
redis裝在linux虛擬機上,在xshell上可以成功訪問redis,配了密碼
拿了老師完整的代碼作測試,就是訪問失敗,不知道哪里出了問題
地址端口密碼都沒錯的,求解
org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.43.52:6379
Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.43.52:6379
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /192.168.43.52:6379
Caused by: java.net.ConnectException: Connection refused: no further information
2019-01-23
如需遠程連接redis,需配置redis端口6379在linux防火墻中開發(fā)
/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT
/etc/rc.d/init.d/iptables save
修改安裝目錄下的redis.conf文件
vim redis.conf
修改以下配置:
#bind 127.0.0.1 # 將這行代碼注釋,監(jiān)聽所有的ip地址,外網(wǎng)可以訪問
protected-mode no # 把yes改成no,允許外網(wǎng)訪問
daemonize yes # 把no改成yes,后臺運行
2018-12-20
redis默認是只能本地訪問,但是可以通過改配置文件,使能夠遠程訪問。網(wǎng)上應該有詳細文檔
2018-11-04
redis.conf配置文件中? bind 127.0.0.1生效,因此只能本機訪問redis