Finding the Redis config file in macOS
Asked Answered
K

3

7

I have installed Redis on my Mac and now I am trying to access Redis config file redis.conf. Where is it located in macOS?

I have tried looking at various resources, but could not find any helpful information.

Klan answered 1/1, 2023 at 16:8 Comment(1)
Please provide enough code so others can better understand or reproduce the problem.Diapositive
E
13

If Redis is running and you can access it with redis-cli - try INFO command. It would expose the location of the config file as the config_file: field.

Example:

$ redis-cli INFO | grep config_file

There is a chance, however, that the Redis was launched without any config file. Then the config_file: would be empty.

You can also start Redis with the specific config file like:

$ </path/to/>redis-server  </path/to/>redis.conf

To find the location of redis-server executable, you can once again use the INFO command:

$ redis-cli INFO | grep executable

For more information refer to the Redis documentation.

Ernaldus answered 2/1, 2023 at 15:16 Comment(0)
T
4

I was confused with the redis having redis.conf file, tried a lot of methods to find it but was unable to find it out. here is where I found out in my machine (Mac OS).

  1. ls /opt/homebrew/etc/redis.conf
  2. ls /opt/homebrew/bin/redis.conf
  3. ls /etc/redis/redis.conf
  4. ls /etc/redis.conf
  5. ls /var/lib/redis/redis.conf

For me it was inside /opt/homebrew/etc

enter image description here

Towns answered 6/1 at 1:53 Comment(0)
E
2

For those who installed redis-stack-server with Homebrew: I found the config file at /opt/homebrew/Caskroom/redis-stack-server/<<VERSION>>/etc/redis-stack.conf.

Elane answered 7/1 at 21:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.