Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if RedisDesktopManager can't connect to Redis remotely?

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how RedisDesktopManager can not connect to Redis remotely, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.

Linux environment: ubuntu16.04

Redis server version: 3.2.6

Redis client download link: https://redisdesktop.com/download

Omit Linux system installation Redis tutorials, there are many online installation tutorials; it is recommended to install with tar.gz package

Redis official website tar.gz download address: wget http://xiazai.jb51.net/201803/yuanma/redis-3.2.6(jb51.net).rar

Download the RedisDesktopManager client, enter the server IP address and port (default: 6379); click the Test Connection button to test the connection, and the connection fails!

What's the problem? The reason is that Redis only supports local links by default. Enter the process command to check it out (127.0.0.1)

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

Kill all the redis kill commands of the cluster, and solve the problem: edit the redis.conf configuration file; comment out 61 lines of local link restrictions and modify 80 lines of configuration to no

61 # bind 127.0.0.1

80 protected-mode no

Read the latest configuration file and restart to check the Redis process! All open IP link permissions, why is it still 127.0.0.1 6379 permissions! Then check the progress:

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 14:00? 00:00:00 / home/wl/hproj/redis-3.0/redis-3.2 .6/src/redis-server *: 7002 [cluster] wl 14202 1416 14:00? 00:00:00 / home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *: 7001 [cluster] wl 14205 1416 14:00? 00:00:00 / home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *: 7004 [cluster] wl 14207 1416 14:00? 00:00:00 / home/wl/hproj/redis-3.0/redis-3.2.6/src/redis-server *: 7003 [cluster] wl 14211 1416 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

Wow, * .6379, which means that IP access has been successfully opened. Everything is ready, all you have to do is click the RedisDesktopManager client test link button. All right, let's go.

When you are full of confidence, reality always pours cold water on you to wake up! Link failure, link failure, I am embarrassed to upload screenshots! What's going on here? Will you let me live or not?

After thinking about it, suddenly, I thought of a word-- firewall.

[root@Karle src] # service iptables status form: filterChain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT all-0.0.0.0 num target prot opt source destination 0 0.0.0.0 Universe 0 state RELATED ESTABLISHED 2 ACCEPT icmp-0.0.0.0.0ACCEPT tcp 0 3 ACCEPT all-0.0.0.0ACCEPT tcp 0 0.0.0.0 0 0.0.0.0ACCEPT tcp 0 4 state NEW tcp dpt:22-- 0.0.0.0 0 0.0.0.0ACCEPT tcp-- 0.0.0.0.0ACCEPT tcp-- 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0ACCEPT tcp-- 0.0.0.0.0ACCEPT tcp-- 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0state NEW tcp dpt:15672 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 reject-with icmp-host-prohibited-- 0.0.0.0 0 0.0.0.0 0 state NEW tcp dpt:15672 9 REJECT all-- 0.0.0.0Uniqle 0.0.0.0.0state NEW tcp dpt:15672 0 0.0.0.0 reject-with icmp-host-prohibited

Edit Linux Firewall

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

Join the firewall rule:-An INPUT-m state-state NEW-m tcp-p tcp-dport 6379-j ACCEPT

[root@Karle src] # service iptables status

Form: filter

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

Restart Linux Firewall

[root@Karle src] # service iptables restart

Click the "Test connection" button to test the connection, which shows "connect to the Redis server successfully", and the problem is solved.

These are all the contents of the article "what if RedisDesktopManager can't connect to Redis remotely". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report