Redis mounted on CentOS manner by Docker
First, ensure that installed docker.
Drag redis Mirror
docker pull redis
Start redis
docker run -p 6379:6379 -v $PWD/data:/data -d redis redis-server --appendonly yes
Command Description:
- -p 6379: 6379: 6379 to map the container port to the host port 6379
- $ the PWD -v / data: / data : The data in the current directory is mounted to the main container / data
- redis-server --appendonly yes: Start command in container execution redis-server, and open the redis persistence configuration
success! ! !