網站首頁 編程語言 正文
問題描述:
redis遠程服務端運行在192.168.3.90計算機上,客戶端計算機(ip:192.168.3.110)通過redsi-cli.exe客戶端工具連接時,沒有反應,連接不上。
如圖所示:
解決步驟:
步驟一:注釋掉redis.window.conf文件中的bind屬性設置。
如圖所示:
步驟二:把protected-mode屬性設置no
重啟redis即可遠程連接。
如圖所示:
確定啟動成功,查看所有keys
清空所有keys
注意事項:
不能直接雙擊redis安裝目錄下bin目錄下的redis-server.exe啟動redis服務端,否則會導致無法通過遠程客戶端進行操作。
如果所示,通過雙擊redis-server.exe命令啟動redis后,然后執行keys查看所有鍵時報錯,
報錯如下異常:
(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 選擇指定端口。
原文鏈接:https://blog.csdn.net/pingweicheng/article/details/81086466
相關推薦
- 2022-06-30 python實現水印圖片功能_python
- 2022-07-09 Python3中的re.findall()方法及re.compile()_python
- 2022-09-08 Go語言里切片slice的用法介紹_Golang
- 2022-12-22 C++?boost?thread庫用法詳細講解_C 語言
- 2022-06-02 Android?View的事件體系教程詳解_Android
- 2022-11-09 Python有序容器的?sort?方法詳解_python
- 2022-08-16 PostgreSQL怎么創建分區表詳解_PostgreSQL
- 2022-09-03 golang?四則運算計算器yacc歸約手寫實現_Golang
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支