the difference between Redis and memcached
The difference between Redis and memcached is simple, and most will get the following view:1 Redis not only supports simple k/v types of data, but also provides storage of data structures such as
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.
Here is a scheme based on Redis to rob red envelopes.
The original red envelopes are called Big Red envelopes, and the red envelopes after the split are called small red envelopes.
1. Small red envelopes are generated in advance, inserted into the
Use Redis to solve:
Redis is installed by default
Introducing Jar Packs
Group ' Org.springframework.session ' name ' Spring-session-data-redis ' version ' 1.3.1.RELEASE '//https://mvnrepository.com/artifact/biz.paluch.redis/lettuce
Group'
For the previous Nginx+tomcat load-balancing mechanism, because there will be session loss, special research on the next Redis session sharing; (if you want to build this environment can start from the previous, involving the nginx of the
Use the following command to update the Yum source and install the Redis service:
RPM-UVH http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
Yuminstall-y Redis
Serviceredis start
Chkconfigredis on
After the installation, we
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
1. Download Redishttps://redis.io/download
2. Decompression, compilation:
$ tar xzf redis-3.2.9.tar.gz
$ cd redis-3.2.9
$ make3.SRC now back out three executable files, redis-server redis-cli redis-benchmark, copy them out of a designated folder,
Waving sway sprinkle write hundreds of words, suddenly found himself is written no others good, original or reprint it.
I will write a few of the better blog address to everyone, and then write some of their own problems and solutions to solve
Start Redis ServiceRedis-server or Redis-server redis.conf
Redis-server redis.conf 1>log.log 2>errlog.log
1 for standard output, 2 for error output randomly booting Redis as a Linux serviceVim/etc/rc.local, add
Six features of Redis
L Strings
L HASHS
L Lists
L Sets
L Sorted Sets
L PUB/SUB Application Scenarios for Redis features Strings
The Strings data structure is a simple key-value type, and value is not only a string, it can also be a number. Common
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
Shiro Cache to Redis management
tags (space delimited): Shiro Redis
Objective:
The following methods are only used by single-use Redis
I. Importing jars for Shiro and Redis
Jedis-2.7.3.jar
shiro-core-1.2.3.jar
shiro-ehcache-1.2.3.jar
Redis Hash is a string-type field and value mapping table, and hash is particularly useful for storing objects.
Each hash in a Redis can store 2^32-1 key-value pairs (more than 4 billion).
Example
127.0.0.1:6379> hmset runoobkey name "Redis
The recent need to design a distributed scheduled task, in theory, Quartz has provided a complete set of distributed scheduled tasks of the solution, but because the system currently has a JMS cluster and Redis Sentinel cluster, if you want to the
The redis hash is a string-type field and a mapping table of value. A key can correspond to multiple fields, and a field corresponds to a value. Storing an object as a hash type can save memory more than storing each field as a string type. When
Redis master-slave replication process
When slave is configured, slave establishes a connection with master and then sends the Sync command. Whether it is the first connection or reconnection, master initiates a background process, saves the DB
The persistence mechanisms of Redis include the RBD and AoF two, which are described in this article for each of these two persistence approaches.
the strategy of the RDB mechanism
RDB persistence refers to the way in which in-memory data and
The master-slave architecture of Redis enables us to read more and write less, so it's easy to configure the Redis architecture below.
Prepare for the Environment VMware + rhel-server-7.0 (101,102,103) +redis-3.2.0
1, installed in 192.168.137.101
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service