PrefaceThis tutorial demonstrates how to install the Redis image, create a Redis container, and map ports to mount data volumes and configuration data. environment
InstallPull the image docker pull redis View Mirror docker images Create and start the MySQL containerCreate data directories and configuration files Create a configuration folder mkdir -p /mydata/redis/conf Create a configuration file touch /mydata/redis/conf/redis.conf Reminder to avoid pitfalls Create the Create and start the MySQL container commandsudo docker run -p 6379:6379 --name redis \ -v /mydata/redis/data:/data \ -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \ -d redis redis-server /etc/redis/redis.conf Parameter Description
View running containersdocker ps Connecting to Redis in Dockerdocker exec -it redis redis-cli Store Value set name zhangsan
get name Setting up Redis persistent storageBy default, redis data is stored in memory. After restart, the data is lost. After setting persistent storage, the data will still be in memory after restart. echo "appendonly yes" >> /mydata/redis/conf/redis.conf This is the end of this article about the implementation steps of Docker installation and configuration of Redis image. For more relevant content about Docker installation of Redis image, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of HTML horizontal and vertical centering issues
>>: Introduction to JavaScript array deduplication and flattening functions
Copy code The code is as follows: <!DOCTYPE HT...
I searched online and found that many interviews ...
To automatically load kernel modules in CentOS, y...
Recently, I have a need to list all host names in...
There are two ways to achieve read-only input: dis...
This article example shares the specific code for...
Table of contents 1 The common rules for creating...
Introduction to void keyword First of all, the vo...
Check whether your cuda is installed Type in the ...
Without further ado, I will post the code for you...
NAT In this way, the virtual machine's networ...
1. Introduction to MMM: MMM stands for Multi-Mast...
<br />Question: Why is it not recommended to...
This article introduces the development environme...
1. overflow:hidden overflow hidden If overflow:hi...