Redis Stack is the bundle of the best of the technology that Redis is offering at a one-place in an easy-to-use package. Starting the Redis stack will start the servers of different technologies that Redis is offering under the Redis Stack. Redis Stack Server extends the core features of Redis OSS, and it provides a complete developer experience.
Technologies Redis offers under the Redis stack:
- rejson
- redisearch
- redisbloom
- redistimeseries
- redisgears
Steps to Run the Redis Stack and the Related in the Local Environment Using Docker
Below are the steps to run Redis Stack in the local environment.
Step 1: Install the Docker from the official website.
Step 2: Update the Windows subsystem of Linux if there occurs version issue with the kernel using the following command in the terminal.
wsl -update
Step 3: Run on the Redis stack server on Docker by selecting the Docker Image:
- redis/redis-stack contains both Redis Stack server and RedisInsight. This container is good for local development because we can use the embedded RedisInsight to visualize our data.
- redis/redis-stack-server provides Redis Stack server only. This container is a best option for Production deployment.
Step 4: Open the terminal and check whether the docker is installed or not using command.
docker --version
After running this command, it will show the docker version in the terminal like below.
Step 5: Start the docker by clicking it from the downloads.
Step 6: Pull the docker image of redis-stack-server or redis-stack from the command line using the below command:
docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
redis-stack command:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
Starting redis-stack starts the redisInsight also at port 8001 and redis-stack-server starts without redisInsights at port 6379. To change the ports where they are getting exposed change the value on the left part after -p.
The redis-stack-server starts running which can be seen in the above image along with the port and status.
Step 7: Run this command to connect to the server using redis-cli
docker exec -it redis-stack-server redis-cli
Step 8: Now check the modules present by using the command below:
MODULE LIST
After running the above command, we can see the Module Lists in terminal.
Operations on Redis Cache using Redis-cli:
- SET: SET key value
- GET: GET key
Operations on redis-bloom using redis-cli:
- INSERT: BF.ADD filter_name value
- EXISTS: BF.EXISTS filter_name value