What does the bind parameter do in Redis?

What is a parameter bindin Redis? The documentation for bindassumes that I already know what it means bind(which I don't have). Does the bindIP address set:

  • server Redis? (I think this is the correct answer, but then I do not understand why this is necessary)
  • a client who will be allowed to connect to Redis? (I tried, and it did not work, possibly wrong)
+7
source share
3 answers

It is the equivalent of the mysql address binding option and works exactly the same.

It associates a Redis instance with a specific interface (and therefore with a specific IP address).

, Redis , , bind. , , .

bind 127.0.0.1

Redis , 127.0.0.1 ( ).

bind 0.0.0.0

(, , , redis), , redis.

- , redis .

+6

redis.conf root, , : nano/etc/redis/redis.conf ,

bind 0.0.0.0.

redis- .

0

The binding XXX.XXX.XXX.XXX will force the server to listen on the address XXX.XXX.XXX.XXX, of course, if this address is not configured on your server, it will not work. You can install multiple ips as follows:

bind 192.168.0.1 127.0.0.1

do not usebind 0.0.0.0 if you use sentinel, it will tell the client that the IP address of the Redis server is 0.0.0.0, and the client will try to connect to itself. instead, if you are on a secure network and want to listen to all interfaces, just comment out the line

protected-mode yes
0
source

All Articles