環境:
本機OS:window 10(本機沒有安裝redis)
redis 服務器:centos 7
使用 Redis Desktop Manager 工具遠程連接 redis。
Redis Desktop Manager 下載地址:https://redisdesktop.com/ 針對windows下,已經不提供免費下載,可以嘗試其他版本。
連接注意三點即可。
一、虛機防火牆是否關閉。
systemctl status firewalld
如果防火牆是active,可以關閉或者添加例外。
我選擇永久關閉:systemctl disable firewalld(即開機不啟動)
二、6379端口是否開放。
查看端口:firewall-cmd --query-port=6379/tcp
打開端口:firewall-cmd --add-port=6379/tcp --permanent (--permanent永久生效,沒有此參數重啟后失效)
三、redis.conf配置文件修改
vi /etc/redis/redis.conf
61 # bind 127.0.0.1 #注釋此行代碼
80 protected-mode no #將yes改為no
reboot即可
說明:redis.conf文件上說用
/usr/local/bin/redis-server /etc/redis/redis.conf
這樣可以解決,但是我試了,貌似沒用。
