I need to install redis version 5.0.14 on my mac using brew.
I have tried multiple ways like brew install [email protected], [email protected], redis@50, redis@5 but nothing seems to work!!
I was able to find out on https://formulae.brew.sh/ that the options that can be installed using brew are redis, [email protected], [email protected] . But I need to install redis 5.0.14 or basically above 5.0.6 because that is the version we have on our production. Can anyone help me out on this?
I have seen a way here that suggests to checkout specific homebrew formulae version but that would become too messy if something goes wrong. I would prefer a straight forward way if there is one.
3
Answers
The version you’re looking for is not available on brew unfortunately.
You could get the source code from here: https://github.com/redis/redis/releases/tag/5.0.14
extract it to some directory, to run Redis with the default configuration just type:
If you want to provide your redis.conf, you have to run it using an additional
parameter (the path of the configuration file):
It is possible to alter the Redis configuration by passing parameters directly
as options using the command line. Examples:
All the options in redis.conf are also supported as options using the command
line, with exactly the same name.
Optionally you could use Docker,
docker run --name some-redis -d redis:5.0.14
Given that the Redis version you require is not available via homebrew, your question is unanswerable. However, given how good docker is on macOS, I have taken to using that rather than homebrew for lots of version-related problems.
With docker:
Official image here.
So, in concrete terms, you could run Redis 5.0.14 as a daemon like this:
and then connect to that same container and run
redis-cli
inside it like this:Or you could run Redis in the container but expose its port 6379 as port 65000 to your regular macOS applications like this:
Then it is accessible to your macOS applications, such as
redis-cli
like this:To have launchd start redis now and restart at login:
To stop it, just run:
Test if Redis server is running.