[Docker] CentOS8 installs Redis through Docker

Docker install redis

1. Pull the latest version of redis

 docker pull redis:latest

insert image description here

Two, start redis

 docker run -id --name=redis -p 6379:6379 redis:latest

insert image description here

3. Enter the redis container

 docker exec -it redis /bin/bash

insert image description here

4. Open the redis client

redis-cli

insert image description here

5. Set a password

Be sure to set a password because the redis server without a password is vulnerable to attack.

config set requirepass 123456

insert image description here

6. Test connection

If it is a purchased cloud server, be sure to open the port in the firewall.
insert image description here

Guess you like

Origin blog.csdn.net/qq_51383106/article/details/131720704