Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. In this article, I will demonstrate how to setup a single node redis server. I will use redis 5.0.0 which is the latest stable version.
Let’s download, extract and compile Redis with:
$ wget http://download.redis.io/releases/redis-5.0.0.tar.gz $ tar xzf redis-5.0.0.tar.gz $ cd redis-5.0.0 $ make
The binaries that are now compiled are available in the src
directory. Run Redis with:
$ src/redis-server
When Redis is running, you can interact with it via redis-cli
:
$ src/redis-cli -h localhost -p 6379 redis> ping PONG redis> set hello world OK redis> get hello "world"
If you are in a Mac, by using Homebrew, simply run:
$ brew install redis
And then start Redis by running:
$ redis-server /usr/local/etc/redis.conf
In Ubuntu, you can install using apt
:
$ sudo apt install redis-server
That’s it. We have successfully installed a single node Redis server. In the next post, I will demonstrate how to setup a highly available Redis cluster.
Leave a Reply