Redis download
Redis official website address
Installation steps
The preparatory work
- Install rz command (used to upload redis files) :
yum install lrzsz
- Install c compiler environment:
yum install centos-release-scl scl-utils-build
,yum install -y devtoolset-8-toolchain
,scl enable devtoolset-8 bash
The installation
- Enter the opt directory.
- Type Rz and select the Redis installation package in the pop-up window
- Unpack the
The tar - ZXVF redis - 6.2.1. Tarl. Gz
- Enter the redis-6.2.1 directory
make
compile
- Compilation failed (no success)
— Jemalloc/jemalloc.h: Does not have that file
So type again: make distclean After cleaning the compiled file, go to Step 4
- perform
make install
- Go to the installation directory:
/usr/local/bin
redis-benchmark
: Performance testing toolredis-check-aof
: Fix the faulty AOF fileredis-check-dump
: Fixes the problem dump. RDB fileredis-sentinel
: Redis cluster useredis-server
: Redis server startup commandredis-cli
: Client, operation entrance
- So far redis has been installed successfully
Start the
The front desk to start the
When the foreground is started, the command line window cannot be closed, otherwise the server stops
Enter the command: redis-server
Type CTRL + C to stop
The background to start
- Copy the redis configuration file to the desired directory
Cp/opt/redis - 6.2.1 / redis. Conf/etc/redis. Config
- Modify the configuration file in etc
vim redis.config
Note: Press/to start search and quickly locate, then enter :wq! save
- The background to start
redis-server /etc/redis.conf
- Check whether the startup is successful
ps -ef|grep redis
Shut down
- Direct input:
redis-cli shutdown
2. Alternatively, log in to the Redis client