A quick primer on the Redis series
Redis series
Redis series cache principle & design
A quick primer on the Redis series
Redis series of data structures
Redis series Redis persistence mechanism
Redis series of master-slave replication
Redis series sentinel mode
Download address
Download from Redis
Install Redis
- Download and unzip
Wget http://download.redis.io/releases/redis ‐ 5.0.3. Tar. Gz tar - XZF redis ‐ 5.0.3. Tar. GzCopy the code
- Install GCC (network required)
yum-yinstallgcc
Copy the code
- Go to the decompressed redis‐5.0.3 directory and compile and install
CD redis‐5.0.3 make make installCopy the code
Explain the meaning of each SRC script in Redis
- Redis-server is the Redis server itself.
- Redis-sentinel is a Redis Sentinel executable (monitoring and failover).
- Redis – CLI is a command-line interface utility that talks to Redis.
- Redis-benchmark Is used to check redIS performance.
- Redis-check-aof and Redis-check-rDB (redis-check-dump in 3.0 and below) are useful in the rare event of data file corruption.
Start the Redis
Run in background mode
- Redis does not use background running by default, if you need to modify the configuration file daemonize=yes, when you start the background service, it will run as a process file.
vim /conf/redis.conf
- Start as a configuration file
redis-server /conf/redis.conf
Copy the code
- Check that Redis is working properly
redis-cli ping
Copy the code
Other Redis operations
Closing the database
Single instance shutdown
Redis - CLI shutdown kill -9 Process ID pkillredis‐serverCopy the code
Multi-instance shutdown
redis-cli -p 6379 shutdown
Copy the code
Check whether port 6379 is listening
netstat -lntp |grep 6379
Copy the code
Check whether background processes exist
ps -ef | grep redis
Copy the code
Connect to Redis and test
redis-cli
ping
Copy the code
Exit the redis
quit
Copy the code