国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Redis > 正文

RedisDesktopManager無法遠程連接Redis的完美解決方法

2020-03-17 12:34:55
字體:
來源:轉載
供稿:網友

Linux環境:ubuntu16.04
Redis服務端版本:3.2.6
Redis客戶端下載鏈接:https://redisdesktop.com/download

省略Linux系統安裝Redis教程,網上安裝教程很多;建議用tar.gz包安裝

下載RedisDesktopManager客戶端,輸入服務器IP地址,端口(缺省值:6379);點擊Test Connection按鈕測試連接,連接失敗!

無法遠程連接,Redis,RedisDesktopManager

什么問題呢?原因是Redis默認只支持本地鏈接,輸入進程命令查看得知(127.0.0.1:7000)

wl@ubuntu:~/hproj/redis-3.0/redis-3.2.6/src$ ./redis-cli shutdown
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
wl@ubuntu:~/hproj/redis-3.0/redis-3.2.6/src$ ps -ef | grep redis
wl        12046   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7001 [cluster]
wl        12047   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7000 [cluster]
wl        12048   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7004 [cluster]
wl        12049   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7002 [cluster]
wl        12050   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7003 [cluster]
wl        12059   1416  0 10:50 ?        00:00:20 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server 127.0.0.1:7005 [cluster]
wl        14070   8680  0 13:52 pts/21   00:00:00 grep --color=auto redis

把集群的redis全部kill命令全部kill掉,問題解決:編輯redis.conf配置文件;注釋掉61行本地鏈接限制以及80行配置修改為no

61 # bind 127.0.0.1
80 protected-mode no

讀取最新配置文件并重啟,查看Redis進程情況!都開放IP鏈接權限了,怎么還是127.0.0.1:6379!!再查看進程情況:

wl@ubuntu:~/hproj/redis-3.0/cluster$ ./redis-start.sh wl@ubuntu:~/hproj/redis-3.0/cluster$ ps -ef | grep rediswl  14200 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7000 [cluster]wl  14201 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7002 [cluster]wl  14202 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7001 [cluster]wl  14205 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7004 [cluster]wl  14207 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7003 [cluster]wl  14211 1416 0 14:00 ?  00:00:00 /home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *:7005 [cluster]wl  14225 8680 0 14:01 pts/21 00:00:00 grep --color=auto redis

哇塞,*.6379,這意味著已經成功開放IP訪問權限了。萬事俱備,只欠點擊RedisDesktopManager客戶端測試鏈接按鈕了。好,走起。

當你信心滿滿的時候,現實總潑你一盆冷水來清醒!鏈接失敗,鏈接失敗,我都不好意思截圖上傳了!!這又是鬧哪樣啊?還讓我活不???

左思右想,突然,我想到一個詞——防火墻

[root@Karle src]# service iptables status表格:filterChain INPUT (policy ACCEPT)num target  prot opt source    destination   1 ACCEPT  all -- 0.0.0.0/0   0.0.0.0/0   state RELATED,ESTABLISHED 2 ACCEPT  icmp -- 0.0.0.0/0   0.0.0.0/0   3 ACCEPT  all -- 0.0.0.0/0   0.0.0.0/0   4 ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:22 5 ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:8080 6 ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:80 7 ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:3306 8 ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:15672 9 REJECT  all -- 0.0.0.0/0   0.0.0.0/0   reject-with icmp-host-prohibited

編輯Linux防火墻

[root@Karle src]# vi /etc/sysconfig/iptables

加入防火墻規則:-A INPUT -m state –state NEW -m tcp -p tcp –dport 6379 -j ACCEPT

[root@Karle src]# service iptables status

表格:filter

Chain INPUT (policy ACCEPT)num target  prot opt source    destination    ACCEPT  all -- 0.0.0.0/0   0.0.0.0/0   state RELATED,ESTABLISHED  ACCEPT  icmp -- 0.0.0.0/0   0.0.0.0/0    ACCEPT  all -- 0.0.0.0/0   0.0.0.0/0    ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:22  ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:8080  ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:80  ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:3306  ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:15672  ACCEPT  tcp -- 0.0.0.0/0   0.0.0.0/0   state NEW tcp dpt:6379  REJECT  all -- 0.0.0.0/0   0.0.0.0/0   reject-with icmp-host-prohibited

重啟Linux防火墻

[root@Karle src]# service iptables restart

點擊 “測試連接” 按鈕測試連接,顯示 “連接Redis 服務器成功”,問題解決了。

無法遠程連接,Redis,RedisDesktopManager

總結

以上所述是小編給大家介紹的RedisDesktopManager無法遠程連接Redis解決方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VEVB武林網網站的支持!


注:相關教程知識閱讀請移步到Redis頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 曲阜市| 临沧市| 察雅县| 靖边县| 凌云县| 绥宁县| 体育| 汝城县| 车致| 含山县| 武宣县| 聂荣县| 武鸣县| 定结县| 江达县| 新干县| 谷城县| 哈密市| 彰化县| 巧家县| 宜城市| 肥东县| 抚松县| 呼图壁县| 延川县| 岑溪市| 公主岭市| 昌宁县| 左贡县| 三明市| 靖远县| 扬中市| 鹤山市| 旬阳县| 攀枝花市| 忻州市| 天水市| 寿光市| 虎林市| 宜宾市| 南汇区|