This is the first day of my participation in the Gwen Challenge in November. Check out the details: the last Gwen Challenge in 2021.

Install Redis in Windows 10

1. Download

Address: github.com/MSOpenTech/…

Right click copy download address, go to thunder what download faster

Unzip to any directory

2. Install

  1. To start, open a CMD console that unzips folders and type the following command
redis-server.exe redis.windows.conf
Copy the code

  1. Open another console and type the following command
redis-cli.exe -h 127.0.0.1 -p6379
Copy the code

You can set a key and it’s successful

Install Redis in CentOS

To install the docker, decompression after open the virtual machine can link: pan.baidu.com/s/1qjK7qD4A… Extract code: L3gz This is the docker issued by my teacher in class, what version of the system is not clear, size 3.6G account/password: root/ hlKJ1.0

1. Install tools

yum -y install gcc automake autoconf libtool make
Copy the code

2. Download the Redis

  1. Downloading compressed packages
wget http://download.redis.io/releases/redis- 5.0.7.tar.gz
Copy the code
  1. Unpack the
tar zxvf redis- 5.0.7.tar.gz
Copy the code

3. The compiling Redis

  1. The decompressed folder is displayed
cd redis- 5.0.7
Copy the code
  1. compile
make
Copy the code

  1. Compile successfully

4. Install redis

  1. Specify a path and install

It should be in the redis5.0.7 folder

make PREFIX=/usr/local/redis install
Copy the code
  1. Successful installation

Add an extra redis to /usr/local

5. Start the Redis server

  1. Into the bin
cd /usr/local/redis/bin
Copy the code

  1. Start the
./redis-server
Copy the code
  1. Start-up success

6. Start the Redis client

  1. Into the bin
cd /usr/local/redis/bin
Copy the code

  1. Start the
./redis-cli
Copy the code
  1. Start-up success

7. Close the client

  1. kill

Example Query the PID of a client

ps -ef |grep -i redis
Copy the code
root      45284  45190  0 15:42 pts/2    00:00:00 vim redis.conf
root      47828  44342  0 20:19 pts/0    00:00:00 ./redis-server* :6379
root      47833  45190  0 20:19 pts/2    00:00:00 grep --color=auto -i redis
Copy the code

Find which line of./redis-server the number after root kills the process

kill 9 - 47828
Copy the code

This method does not save data in memory

  1. shutdown

Enter directly in the client

shutdown save
Copy the code

This saves data in memory