Look at the method of writing on the network, the basic is to use Homebrew for installation, but execute the following installation statement

brew install redis
Copy the code

An error:

Error: Could not find an SDK that supports macOS 11.5. You may have an outdated or incompatible CLT. Homebrew found the following SDKsinThe CLT install: 10.14 10.15Copy the code

Brew is not supported on macOS Big Sur, it is being updated…

I didn’t want to spend time researching BREW, so I chose the most straightforward manual installation: first go to redis website :redis. IO/Download

Download a stable version of Redis.

After decompressing the redis directory locally, move the redis folder to /usr/local/, open the terminal, go to /usr/local/, compile and install:

cd /usr/local/ redis - 6.2.5 make make installCopy the code

Then performredis-serverYou can start the Redis service.Open a terminal again and type:

redis-cli
Copy the code

Ready to enter.

To shut down the service, enter the following command on the terminal:

redis-cli shutdown
Copy the code

You can also find out the PID corresponding to redis and forcibly stop it.

ps aux|grep redis
kill-9 Found PIDCopy the code

You can also set up the daemonize daemon (default no), open the redis.conf file, find the daemonize, change no to yes, and type:

cd /usr/local/ redis - 6.2.5 vim redis. ConfCopy the code

In this mode, Redis runs in the background and writes the process PID number to the file set by the redis. Conf option pidfile. Redis will run until the process is killed manually.

Reference:

Redis daemonize introduce www.jianshu.com/p/5a187bfd4…

MAC OS install redis www.jianshu.com/p/3bdfda703…