redis遠程服務端運行在192.168.3.90計算機上,客戶端計算機(ip:192.168.3.110)經過redsi-cli.exe客戶端工具鏈接時,沒有反應,鏈接不上。redis
步驟一:註釋掉redis.window.conf文件中的bind屬性設置。windows
如圖所示:ide
重啓redis便可遠程鏈接。工具
如圖所示:oop
肯定啓動成功,查看全部keysthis
清空全部keysspa
注意事項:3d
不能直接雙擊redis安裝目錄下bin目錄下的redis-server.exe啓動redis服務端,不然會致使沒法經過遠程客戶端進行操做。rest
若是所示,經過雙擊redis-server.exe命令啓動redis後,而後執行keys查看全部鍵時報錯,code
報錯以下異常:
(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
緣由分析:從啓動成功界面分析,這種方式的啓動讀取的配置文件可能不是redis.windows.conf文件,故以前設置的內容沒有生效。
因此啓動redis時,經過進入redis安裝目錄下的bin目錄,而後執行
redis-server redis.windows.conf
命令啓動名。
另外redis-cli客戶端鏈接redis服務端命令以下
redis-cli -h 192.168.3.90 -p 6379
-h 選擇指定服務端ip
-p 選擇指定端口。