Getting started with Redis on macOS

Assuming you have homebrew (https://brew.sh/) installed on your system, Redis can be configured as follows:

$ brew install redis

After the successful execution of the preceding command, you will see some notifications. We can continue with the rest of the commands. To check whether Redis is installed correctly or to get package information, we can run the following commands:

$ brew info redis

You should be able to see the following output:

Figure 11.1: Output of the command 

To run the Redis server, we can use the following command:

$ redis-server

The redis-server command should give you Terminal output, such as the screenshot that follows:

Figure 11.2: Output of the terminal after running the Redis server

To check whether the Redis server is working, we can run the server using the preceding command, and in another Terminal, run the ping command:

$ redis-cli ping 
PONG

The successful configuration will return with the PONG response immediately. We can start running redis-cli and start creating key-value pairs:

$ redis-cli
127.0.0.1:6379>
127.0.0.1:6379> set myapp:name "My Awesome E-com Store"
OK
127.0.0.1:6379> get myapp:name
"My Awesome E-com Store"

In a similar manner, Redis can be installed on a Windows machine. Follow the official instructions documented on its website (https://redis.io/) to install it on a Windows machine. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset