Redis Chinese APICategory: Database 2012-06-12 17:38 1412 people read comments (1) Favorites Report Redis API list DataSet server database
Redis all the orders.
>
Lpop key: Deletes and obtains an element of the list headerRpop key: Deletes and
installing the JDK and configuring environment variables
1. Download JDK
2. Decompression
Tar xzf jdk-7u79-linux-x64.tar.gz
3. Configure environment variables (reboot required after configuration is complete)
Open/etc/profile with a text
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
1, the system integrates the Redis service. Redis configuration in the properties file:
redis.host=127.0.0.1
redis.port=6379
redis.default.db=0
redis.timeout=100000
redis.maxactive=
redis.maxidle=100
1. Normal execution
MULTI
Set K1 v1
Set K2 v2
Get K1
Set K3 v3
Exec
2. Discard Transactions
MULTI
Set K1 v1
Set K2 v2
Set K3 v3
DISCARD
3. All guilt
MULTI
Set K1 v1
Set K2 v2
Set K3 v3
Getset K3
Set K4 v4
Set K5 v5
Exec
ERROR,
4.
In a real-world working environment, Redis is installed on the server, and we want to use the Redis terminal for Redis services. Redis-desktop-manager is to connect the Redis service and we can learn to use it.
First, install Redis-desktop-manager,
Reference: https://jingyan.baidu.com/article/2c8c281dbd079f0008252a0f.html
https://blog.csdn.net/qq_36663951/article/details/78340303
The Redis cache is efficient, but it takes up valuable memory resources in our system, especially when our
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
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
Redistemplate default serialization mode is Jdkserializeable, stringredistemplate default serialization is Stringredisserializer
You can change the serialization of redistemplate by manually configuring it
Package Com.wenbronk.data.redis;
Import
Reprinted from: http://blog.csdn.net/freebird_lb/article/details/7778981
Redis is an in-memory database that supports persistence, which means that Redis often needs to synchronize in-memory data to disk to ensure persistence. Redis supports four
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
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
Introduction
Common commands: Hget;hset;hgetall, etc.
We can consider the hashes type in Redis as a map container with string key and string value. Therefore, this type is ideal for storing information about value objects. such as username,
Redis a master multi-slave spring configuration
public class redistest{private ApplicationContext context;
Private Redistemplate redistemplate;
Final String key = "Key7";
@Before
Redis is an in-memory database that supports persistence, which means that Redis often needs to synchronize in-memory data to disk to ensure persistence. Redis supports two persistence modes, one is snapshotting (snapshot) is the default, and the
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