meimaymay
meimaymay

Reputation: 11

RedisInsight connection to Redis on Linux through IP address

I am running Redis on Linux through VMware. CENTOS7 Linux IP address and connection screenshot below:

IP address

I've commented # bind 127.0.0.1 to allow remote connection in redis.conf file on Linux. Also, I didn't set any password.

When I try to use RedisInsight on my Mac OS to remote connect to Redis on Linux by adding Redis database on RedisInsight as below, the connection doesn't work.

I've tried 4 IP addresses 192.168.41.128, 192.168.41.255, 192.168.41.2 and 192.168.41.0 as host address. But none of them worked. Please see RedisInsight screenshot below.

RedisInsight inputs

Am I doing anything wrong on redis remote connection? Could someone please guide me how to connect to Redis on Linux from the RedigsInsight on MacOS?

I tried commands "ip a" and "ip r" to get IP address on Linux. Also, I commented "Bind 127.0.0.1" in redis.conf file.

Upvotes: -1

Views: 588

Answers (1)

meimaymay
meimaymay

Reputation: 11

I figured it out. Key steps below. Detailed commands I asked ChatGPT and it was quite helpful.

  1. in redis.conf on CentOS 7 Linux, comment out #bind 127.0.0.1 or set it to "bind 0.0.0.0", set "protected-mode no" to "protected-mode yes" 2.set port 6379 as a port that allows remote connection under firewall settings "sudo firewall-cmd --zone=public --add-port=6379/tcp --permanent"
  2. for the ip address to use, I just use the inet address showed under command "ip a" (192.168.xxx.xxx)

Upvotes: 0

Related Questions