当前位置:网站首页>Redis overview installation
Redis overview installation
2022-07-19 08:26:00 【Illusory clarity】
1、 Redis It's an open source key-value The storage system .
2、 and Memcached similar , It supports storage value There are more types , Include
string( character string )、 list( Linked list )、set( aggregate )、zset(sorted set
-- Ordered set ) and hash( Hash type ).
3、 These data types support push/pop、add/remove And intersection Union
Sum and difference sets and richer operations , And these operations are atomic .
4、 On this basis ,Redis Support various sorts of sorting .
5、 And memcached equally , To ensure efficiency , The data is cached in memory .
6、 The difference is Redis It will periodically write the updated data to disk or modify
Write the additional record file .
7、 And on this basis to achieve master-slave( Master-slave ) Sync .
1、 Application scenarios
Cache with relational database
High frequency , Hot access data , Lower the database IO Distributed architecture , do session share
- A variety of data structures store persistent data
Redis Installation
Redis Official website
Redis Official website in Chinese
1、 Installed version
6.2.1 for Linux(redis-6.2.1.tar.gz)
Don't think about it windows Environment Redis Support for
Installation steps
2.2.2.1. preparation : Download and install the latest version of gcc compilerinstall C The compiling environment of language yum install centos-release-scl scl-utils-build yum install -y devtoolset-8-toolchain scl enable devtoolset-8 bash test gcc edition gcc --version
2.2.2.2. download redis-6.2.1.tar.gz discharge /opt Catalog
2.2.2.3. Unpack the command :tar -zxvf redis-6.2.1.tar.gz
2.2.2.4. After decompression, enter the directory :cd redis-6.2.1
2.2.2.5. stay redis-6.2.1 Execute... Again in the directory make command ( only Is compiled )
2.2.2.6. If not ready C Language compiling environment ,make Will be submitted to the wrong —Jemalloc/jemalloc.h: There is no such document
2.2.2.7. Solution : function make distclean
2.2.2.8. stay redis-6.2.1 Execute... Again in the directory make command ( only Is compiled )
2.2.2.9. skip make test Carry on : make install
2.2.3. The installation directory :/usr/local/bin View the default installation directory :
redis-benchmark: Performance testing tools , You can run it in your own book , Look at the performance of your book
redis-check-aof: Fix the problem AOF file ,rdb and aof Later on
redis-check-dump: Fix the problem dump.rdb file
redis-sentinel:Redis Cluster use
redis-server:Redis Server start command redis-cli: client , Operation entrance
2.2.4. The front desk starts ( Not recommended )
The front desk starts , The command line window cannot be closed , Otherwise, the server stops .
2.2.5. Background start ( recommend )
2.2.5.1. Backup redis.conf Copy a redis.conf Go to other directories cp /opt/redis-3.2.5/redis.conf /myredis
2.2.5.2. Background startup settings daemonize no Change to yes modify redis.conf(128 That's ok ) The document will contain daemonize no Change to yes, Let the service start in the background
2.2.5.3.Redis start-up redis-server/myredis/redis.conf
2.2.5.4. Use the client to access :redis-cli
2.2.5.5. Multiple ports can :redis-cli -p6379
2.2.5.6. Test verification : ping
2.2.5.7.Redis close
Single instance close :redis-cli shutdown
Multi instance shutdown , The specified port is closed :redis-cli -p 6379 shutdown
2.2.6. Redis Introduce relevant knowledge
Redis A single thread + multiple IO Multiplexing technology
Multiplexing is the use of a single thread to examine multiple file descriptors (Socket) The ready state of , For example, call select and poll function , Pass in multiple file descriptors , If there is a file descriptor ready , Then return to , otherwise Block until timeout . After getting the ready state, the real operation can be executed in the same thread , You can also start Dynamic thread execution ( Like using thread pools )
Serial vs Multithreading + lock (memcached) vs Single thread + multiple IO Reuse (Redis)
( And Memcache Three different things : Supports multiple data types , Support persistence , Single thread + multiple IO Reuse )
边栏推荐
猜你喜欢
写代码遇到Qt相关问题
从 B 站崩溃报告看分布式系统的技术栈
1. Flask Foundation
New redis6 features
MySQL 2502 2503 error
全志V3s学习记录(13)OV2640的使用
Interview question: outer margin folding problem (bug of block level elements in ordinary document flow)
60、wsgiref手写web框架+jinja2模块初识
With this "programmer code interview guide" from Zuo Chengyun (Zuo Shen), I joined byte
WVPPRO-ZLM-GB21818-摄像头
随机推荐
總結的太好了!終於有人把SQL的各種連接Join都講明白了
QT related problems encountered when writing code
5.1 security vulnerabilities and Prevention
JS学习笔记04-05——构造函数的修改以及使用工厂方法创建
Database review -- database recovery technology
总结的太好了!终于有人把SQL的各种连接Join都讲明白了
Super dry! Thoroughly understand golang memory management and garbage collection
Understanding of fast and slow pointer
Do online usdt and usdc want to be short? Take you to find out | tokenview
Redis 概述安装
网传USDT和USDC要做空?带你一探究竟 | Tokenview
How to select MCU?
Dark horse programmer - software testing -16 stage 3 - function testing -175-198, URL composition introduction, request content and composition description line function test and database, URL composi
leetcode:287. Find the repetition number [fast and slow pointer board]
Go language Bible
49、Mysql使用
演示集合注入
WVPPRO-ZLM-GB21818-摄像头
How to convert STR in read list to float
Redis distributed lock