1, download, compile, install
Https://redis.io/download
wget xxxxx 2, set up service automatic background start (1), copy initialization scriptFirst, the Utils/redis_init_script file is copied to the/ETC/INIT.D, and the REDISD is easily named.
1. redis.conf Configuration parameters:
#是否作为守护进程运行
Daemonize Yes
#如以后台进程运行, you need to specify a PID, which defaults to/var/run/redis.pid
Pidfile Redis.pid
#绑定主机IP, the default value is 127.0.0.1
#bind 127.0.0.1
#Redis默认监听端口
Port 6379
#客户端闲置多少秒后,
There are often scenarios where counters need to be used in business requirements: for example, a mobile number restricts the sending of 5 messages a day, how many requests an interface can limit in one minute, how many times a single interface is
Related commands: DISCARD EXEC MULTI unwatch WATCH transaction
Multi,exec,discard and watch are the basis of Redis transactions. They allow a set of commands to be executed in one step, with two important guarantees: All commands in the transaction
Redis zrevrank Command
Redis ordered set (sorted set)
The Redis zrevrank command returns the rank of the member in the ordered set. Where ordered set members are sorted by fractional values descending (from large to small).
The ranking is based
Function Introduction
Most of the users like to use Redistemplate, and its corresponding package is org.springframework.data.redis.core. The template is actually the core class of the Redis module because of its rich functionality. Templates
Preface
An ordered collection type is the highest and most complex type of Redis five data types.
After explaining set, we see the difference between set and sorted set.
Compared with set, sorted sets is to add a weight parameter to the elements in
Integration with spring
What jar packages I need.
org.springframework.data
spring-data-redis
redis.clients
jedis
How to configure the spring configuration file.
General, only need to configure redistemplate or
one, MySQL has 2000w data, Redis only 20w of data, how to ensure that the data in Redis are hot data
related knowledge: when the Redis memory dataset size rises to a certain size, it will implement a data-phase-out strategy. Redis offers 6 kinds of
11 Types of Redis Web application Scenarios2015-04-07 10:46 Anonymous Gray's blog size: T | T
Some Redis primitive commands, such as Lpush, LTrim, and Lrem, can be used to help developers accomplish the tasks they need--tasks that are difficult or
In general, Redis's Zset provides a wealth of functionality that can form many applications.
In Redis, there are many features that are available.
Ordered set (Sorted set) zadd zrem zcard zcount zscore zincrby zrange zrevrange zrangebyscore
Redis persistence mechanism
Redis is an in-memory database that supports persistence, which means that Redis often needs to synchronize the in-memory data to the hard disk to persist.
Redis persistence two ways RDB and AOF
1.snapshotting
1. Error message:
Redis Login Displays the following error message:
(Error) misconf Redis is configured to save RDB snapshots, but
it's currently not able to pers IST on disk. Commands
. Modify the data set is disabled, because this instance was
Redis receives a connection from a client by listening to a TCP port or a UNIX socket, and when a connection is established, the following actions are performed within Redis:
• First, the client socket is set to non-blocking mode because Redis uses
First, Protected-mode
By default, Redis node and Sentinel Protected-mode are yes, and if you want to connect a Redis cluster remotely from a remote connection, you need to modify the Protected-mode of Redis node and Sentinel to No, If you only
Source: Click to open the link
For cache invalidation, different cache has different processing mechanism, it can be said that there is a small difference in Datong, the author through the Redis documents and related source of the careful reading,
1, undefined reference to ' clock_gettime ' link wrong solution
When installing Redis, compile file make the Redis folder this error, clock_gettime in real Time library LIBRT, because the link is not linked to this library caused an error.
Solution
(Error) DENIED Redis is running in protected mode because protected mode is enabledRedis Protected-mode is a new feature added after 3.2, and in Redis.conf's comments we can see that his specific role and enabling conditions
Redis can only be linked
Transactions
Redis's transactional capabilities allow users to wrap multiple commands, and then execute all the commands that are wrapped in a single, sequential manner. During the execution of a transaction, the server does not break the
An ordered set is a part of the Redis object system, which is stored in the form of a skip table and a compression list, and in the previous article, it introduces the implementation of the jumping table, and the realization of the jumping table of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.