InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac Command Line tutorials

  • Bulk convert jpeg files to png using sips on mac
  • Custom terminal tab title and ssh on mac
  • How to convert text to speech on Mac using command line utility say
  • How to join multiple pdf files on Mac
  • How to use qpdf to add/remove password from pdf on mac
  • Install redis on Mac
  • Mac - find which process is listening on a port
  • Mac - hide and unhide a file or directory
  • Mac - open a terminal from a folder
  • Mac - print java home on command line
  • Mac - search files on command line using mdfind
  • Mac command line convert svg to png
  • Mac command line utility open - some handy tips for better productivity
  • Mac terminal - how to close shell on exit
  • mac pkgutil - quick start guide
 
  • Home
  • > Tutorials
  • > Mac
  • > Mac Command Line

Install redis on Mac

on Mar 3, 2016

Redis is an open source, in-memory data structure store, used as database, cache and message broker. It is one of the most popular key-value nosql database. Also note that the name Redis means REmote DIctionary Server.

Here are installation steps for redis on Mac using brew.

  1. Get redis package info

    $ brew info redis
    redis: stable 3.0.7 (bottled), HEAD
    Persistent key-value database, with built-in net interface
    http://redis.io/
    Not installed
    From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/redis.rb
    ...
    ...
    
  2. Install redis using brew

    $ brew install redis
    
  3. List installed files

    $ brew list redis
    /usr/local/Cellar/redis/3.0.7/bin/redis-benchmark
    /usr/local/Cellar/redis/3.0.7/bin/redis-check-aof
    /usr/local/Cellar/redis/3.0.7/bin/redis-check-dump
    /usr/local/Cellar/redis/3.0.7/bin/redis-cli
    /usr/local/Cellar/redis/3.0.7/bin/redis-sentinel
    /usr/local/Cellar/redis/3.0.7/bin/redis-server
    /usr/local/Cellar/redis/3.0.7/homebrew.mxcl.redis.plist
    
  4. In case you want to start redis at login add symlink in ~/Library/LaunchAgents. Note that it will start redis as current user. This info can also be obtained by command brew info.

    $ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
    
  5. To start redis one time as current user:

    $ launchctl load /usr/local/opt/redis/homebrew.mxcl.redis.plist
    
  6. View redis config

    $ less /usr/local/etc/redis.conf 
    
  7. View redis log

    $ tail -f /usr/local/var/log/redis.log
    ...
    59980:M 03 Mar 14:01:37.643 # Server started, Redis version 3.0.7
    59980:M 03 Mar 14:01:37.658 * DB loaded from disk: 0.015 seconds
    59980:M 03 Mar 14:01:37.658 * The server is now ready to accept connections on port 6379
    
  8. Look at redis db file

    $ ls -l /usr/local/var/db/redis/
    -rw-r--r--  1 user1  admin  33 Jan 21 09:33 dump.rdb
    
  9. Try out few redis-cli commands
    $ echo "set key1 value1" | redis-cli
    OK
    $ echo "INFO keyspace" | redis-cli
    # Keyspace
    db0:keys=1,expires=0,avg_ttl=0
    $ echo "KEYS *" | redis-cli
    1) "key1"
    

    You may also want to visit redis cli quick start tutorial

Suggested posts:

  1. How to install Imagemagick on Mac
  2. redis cli quick start tutorial
  3. Mac brew (homebrew) – quick start guide
  4. Mac brew – how to find latest available package without installing
  5. How to install phantomjs on Mac
  6. How to install drupal on Mac usin MAMP
  7. How to install casperjs on Mac
  8. Mac brew – how to relink installed binaries for a package
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line, redis, Tutorials

Follow InfoHeap

facebook
twitter
googleplus
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2023 InfoHeap.

Powered by WordPress