redis / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
http://redis.io
Other
66.31k stars 23.72k forks source link

[QUESTION] Can I set bind option with IP range in redis.conf? #13341

Open jojo030ring opened 3 months ago

jojo030ring commented 3 months ago

bind 192.xx.xx.xx > I know it's okay, but I want to set 192.20.1.0 ~ 192.20.1.255 What should I do? bind 192.20.1.* is not working....

kubernetes and rockylinux....

sundb commented 3 months ago

now we can't do that, in what cases would you need to bind so many ports?

ptjm commented 3 months ago

Taking a guess, suppose you had a common config file for a bunch of machines which had both a public and private network. You want to listen on the internal network but not the external. It might be convenient to put

bind 127.0.0.1 192.168.20.0/24

and have it listen at whatever IP addresses the machine has open from that range. I guess the typical solution to that problem is to have an include file on each machine to set the bind address.