This article implements the function
Redis installation tutorial on windows
Redis installation on centos
Use docker to install Redis
Implementation environment
##window installation redis tutorial
- ##centos7.3
- docker
- VM virtual machine
Download address:
You will see after entering Go to such a page, click Download
# and then unzip the downloaded file and put it under your own drive letter
Click redis-server to start the redis service, and then open a terminal to use redis
window installation of redis is very simple, you can do it during the learning process Use window to learn, but the actual work is still based on Linux.
linux installation Redis
Download the redis installation package
wgethttp://download.redis.io/releases/redis-4.0.8.tar.gz
Unzip the installation package
tar xzvf redis-4.0.8.tar.gz
Enter the installation package
cd redis-4.0.8Execute make
Then Move redis-4.0.8 to /usr/local
mv redis-4.0.8 /usr/local
Modify redis.conf configuration
Set password
##Comment bind 127.0.0.1 (this can only be connected using the local machine, so it needs to be commented out)
The default is non-daemon mode
Exit after completing the above operations
Then enter /sur/local/redis/src and executeWhen using redis, remember to enter a password. If you don’t want to enter a password, you can do the above operation without setting a password
The above is the installation of redis on linux
Here I’ll talk about turning off the redis service. This is not turned off because the password is set, so we need to add the password to turn off the redis service
You can see that there is a redis process running now
The correct shutdown method redis-cli -a fang1996 shutdown
Prerequisite: You have docker on centos
First pull the redis4.0 image
docker pull redis:4.0
View the image docker image ls
At this time the redis image has been pulled down
I have defined a network here 172.10.0.0/16
Create redis container: docker run -itd --name redis --net mynetwork -p 6380:6379 --ip 172.10.0.2 redis:4.0
Enter docker in the redis container exec -it redis /bin/bash
There is no redis.conf configuration file in the container at this time. Exit the container and copy a copy to the redis container
docker cp / usr/local/redis-4.0.8/redis.conf a782d31cc4ac:/etc/ Then you can use redis.conf to open itThe above is the detailed content of Redis installation guide covers Windows, Linux, Docker. For more information, please follow other related articles on the PHP Chinese website!