小編給大家分享一下RedisDesktopManager無(wú)法遠(yuǎn)程連接Redis怎么辦,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
成都創(chuàng)新互聯(lián)公司于2013年成立,先為湛河等服務(wù)建站,湛河等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢(xún)服務(wù)。為湛河企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。Linux環(huán)境:ubuntu16.04
Redis服務(wù)端版本:3.2.6
Redis客戶(hù)端下載鏈接:https://redisdesktop.com/download
省略Linux系統(tǒng)安裝Redis教程,網(wǎng)上安裝教程很多;建議用tar.gz包安裝
Redis官網(wǎng)tar.gz下載地址:wget http://xiazai.jb51.net/201803/yuanma/redis-3.2.6(jb51.net).rar
下載RedisDesktopManager客戶(hù)端,輸入服務(wù)器IP地址,端口(缺省值:6379);點(diǎn)擊Test Connection按鈕測(cè)試連接,連接失?。?/p>
什么問(wèn)題呢?原因是Redis默認(rèn)只支持本地鏈接,輸入進(jìn)程命令查看得知(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掉,問(wèn)題解決:編輯redis.conf配置文件;注釋掉61行本地鏈接限制以及80行配置修改為no
61 # bind 127.0.0.1
80 protected-mode no
讀取最新配置文件并重啟,查看Redis進(jìn)程情況!都開(kāi)放IP鏈接權(quán)限了,怎么還是127.0.0.1:6379?。≡俨榭催M(jìn)程情況:
wl@ubuntu:~/hproj/redis-3.0/cluster$ ./redis-start.sh wl@ubuntu:~/hproj/redis-3.0/cluster$ ps -ef | grep redis wl 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,這意味著已經(jīng)成功開(kāi)放IP訪問(wèn)權(quán)限了。萬(wàn)事俱備,只欠點(diǎn)擊RedisDesktopManager客戶(hù)端測(cè)試鏈接按鈕了。好,走起。
當(dāng)你信心滿(mǎn)滿(mǎn)的時(shí)候,現(xiàn)實(shí)總潑你一盆冷水來(lái)清醒!鏈接失敗,鏈接失敗,我都不好意思截圖上傳了!!這又是鬧哪樣???還讓我活不???
左思右想,突然,我想到一個(gè)詞——防火墻
[root@Karle src]# service iptables status 表格:filter Chain 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
加入防火墻規(guī)則:-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
點(diǎn)擊 “測(cè)試連接” 按鈕測(cè)試連接,顯示 “連接Redis 服務(wù)器成功”,問(wèn)題解決了。
以上是“RedisDesktopManager無(wú)法遠(yuǎn)程連接Redis怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計(jì)公司行業(yè)資訊頻道!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。
分享題目:RedisDesktopManager無(wú)法遠(yuǎn)程連接Redis怎么辦-創(chuàng)新互聯(lián)
文章鏈接:http://muchs.cn/article4/cdgdie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營(yíng)銷(xiāo)推廣、品牌網(wǎng)站制作、網(wǎng)站設(shè)計(jì)公司、定制開(kāi)發(fā)、ChatGPT、軟件開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容