Tutorial on how to start redis server on Mac

Posted in Uncategorized

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

This tutorial, we will learn how to start the redis server on Mac, assuming that you have already got it installed via “brew install redis” or other method found on the internet.

You can start redis manually by …

redis-server

Or start redis with a configuration file like this…

redis-server /usr/local/etc/redis.conf

To stop the redis server, Ctrl-C.

Running Redis in the Background

To start redis server and have it run in the background and give you back the terminal prompt, you type …

redis-server --daemonize yes

You can see the process running by typing …

ps aux | grep redis-server

And stop the process by …

redis-cli shutdown

How to Tell if Redis is Running

You can tell when redis is running by opening a new terminal window and typing …

redis-cli ping

You will get response of “PONG” if redis is up.

Redis Always On

To have launchd start redis now and restart at login, you can run …

brew services start redis

And it will install an install an launch agent at …

~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Uninstalling Redis

To uninstall redis, you can do…

brew uninstall redis

But remember to remove the launch agent if you have added it by …

rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist


Related Posts

Tags

Share This