How to Setup Redis Server in The Cloud on Azure/AWS/GCP

To setup and install Redis®* server on any of the cloud platforms, the easiest way is to use the image available in the cloud marketplaces below.  Redis® is an open source (BSD licensed), in-memory data structure store, used as a redis database, redis cache, and message broker.

Run Redis® Server in the Cloud

Table of Contents

Redis Server features

  • Versatile data structures
  • Transactions
  • Pub/Sub
  • Lua scripting
  • Geospatial
  • Keys with a limited time-to-live
  • LRU eviction of keys
  • Cluster / Automatic failover
  • Supported languages include Java, Python, PHP, C, C++, C#, JavaScript, Node.js, Ruby, R, Go and many others.

Getting Started with Redis Server

Once your Redis® server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, you’re ready to start configuring Redis.

Using Redis

Redis-server is configured to start automatically.

Check if Redis is working

External programs talk to Redis using a TCP socket and a Redis specific protocol. This protocol is implemented in the Redis client libraries for the different programming languages. However to make hacking with Redis simpler Redis provides a command line utility that can be used to send commands to Redis. This program is called redis-cli.

 

The first thing to do in order to check if Redis is working properly is sending a PING command using redis-cli and we should get a PONG reply as below:

				
					redis-cli ping

				
			

Running redis-cli followed by a command name and its arguments will send this command to the Redis instance running on localhost at port 6379. You can change the host and port used by redis-cli, just try the –help option to check the usage information.

 

Another interesting way to run redis-cli is without arguments: the program will start in interactive mode, you can type different commands and see their replies.

				
					redis-cli
				
			

Redis Default Configuration

Redis has been setup with the default configuration:

 

Listening port: 6379

Redis Config file on Ubuntu: /etc/redis/redis.conf

Redis Config file on CentOS: /etc/redis.conf

Logfile: The path to where you would like your logs stored can be set within the redis.conf under logfile ” “ line

Redis Documentation

Documentation on using Redis can be found on : https://redis.io/documentation

Redis Firewall Ports

By default Redis is set to listen on port 6379

 

For a full list on the required firewall ports, review – 

 

Clustering Ports:

 

https://docs.redislabs.com/latest/rs/administering/designing-production/networking/port-configurations/

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Disclaimer: * Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Cloud Infrastructure Services Ltd is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Cloud Infrastructure Services Ltd
Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud

5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x