Last active
May 4, 2016 16:44
-
-
Save rcanepa/3af52196da6febceab0f6ae64d9a3f3f to your computer and use it in GitHub Desktop.
Installing and working with Redis on OSX and Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ------------------ | |
| OSX | |
| ------------------ | |
| - Install redis via homebrew | |
| homebrew install redis | |
| - Tap services to start/stop services | |
| brew tap homebrew/services | |
| - Start, stop or restart redis | |
| brew services [start/stop/restart] redis | |
| - Additionally, redis can be started and stopped like this | |
| sudo launchctl start io.redis.redis-server | |
| sudo launchctl stop io.redis.redis-server | |
| - Alias for those commands (.bash_profile) | |
| alias redisstart='sudo launchctl start io.redis.redis-server' | |
| alias redisstop='sudo launchctl stop io.redis.redis-server' | |
| - Start or stop redis using those commands/alias | |
| redisstart | |
| redisstop | |
| - Configuring a password | |
| 1. Edit file /usr/local/etc/redis.conf | |
| 2. Uncomment line (396 app): #requirepass somepassword | |
| 3. Change somepassword to something else | |
| 4. Restart redis: brew services restart redis | |
| ------------------ | |
| Ubuntu | |
| ------------------ | |
| - Pre-install step | |
| sudo apt-get update | |
| sudo apt-get install gcc make build-essential tcl8.5 | |
| - Installing steps | |
| 1. Download the latest stable release of Redis: wget http://download.redis.io/releases/redis-stable.tar.gz | |
| 2. Untar it: tar xzf redis-stable.tar.gz | |
| 3. Go into the directory: cd redis-stable | |
| 4. Run the "make" command: make | |
| 5. Run the recommended test: make test | |
| 6. Finally, finish by making the install: make install | |
| - Post-install | |
| Redis comes with a script that enables it to run in the background. | |
| 1. Navigate into the "utils" folder: cd utils | |
| 2. Run the script: sudo ./install_server.sh | |
| - Start and stop | |
| sudo service redis_6379 start | |
| sudo service redis_6379 stop | |
| - Redis command line tool | |
| redis-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment