Redis is a lightweight, memory-based key-value database (Key-value);
Official website: https://redis.io/
Download page: Https://redis.io/download
Current stable version: 4.0.11
Docker Image address: https://hub.docker.com/r/library/redis/
First, the following describes the Docker environment installation Redis
1. Download the image
$ Docker Pull redis:4.0.11
2. Start Redis
$ docker Run--name redis-server-p 6379:6379-d redis:4.0.11 redis-server--appendonly Yes
3. View
$ Docker exec-it eea5 redis-cli-h 127.0.0.1-p 6379-a '
or Docker exec-it Eea5 redis-cli
Default native 6379 default port
$ set Test test
$ set Test1 test1
$ get Test
$ info
Output all metrics for the currently connected Redis instance, including:
Server: Basic information about the Redis server
Clients: Status and metrics for client connections
Memory: Approximate RAM consumption metrics
Persistence: Data persistence-related status and metrics
Stats: Overall statistics
Replication: status and metrics related to master-slave replication
Cpu:cpu Use Cases
Cluster:redis Status of Cluster
Keyspace: Statistics that the database thinks about
4. Stop
$ docker Stop Eea5
Recommended stop mode by REDIS-CLI down with shutdown
5. Start a stopped container
$docker Start EEA5
Executable files include:
Redis-server:redis Service Side
Redis-sentinel:redis Sentinel
Redis-cli:redis command-line tools
Redis-check-rdb:redis RDB Check Tool
Redis-check-aof:redis Append only Files (aof) Check tool
Redis-benchmark:redis Benchmark/Performance testing tools
Second, Mac installation Redis Visualizer-redis Desktop Manager
Ref: 71378551
Direct download: https://pan.baidu.com/s/10vpdhw7YfDD7G4yZCGtqQg
Three, Redis event model
Single-threaded, non-blocking, multiplexed I/O models; (in some cases, threads or sub-threads are also created to perform certain tasks)
Contains a simple but powerful library of asynchronous events called AE, which encapsulates the polling mechanisms of different operating systems (non-blocking I/O related mechanisms) such as Epoll, Kqueue, select, etc.
Most common problem: latency issues (Redis cannot process other commands until a command is processed)
Redis Learning 01