The following sample code includes 2 demos:
One is an example of how to add, modify, add, reduce, and delete string type data;
The other is an example of how to add, modify, add, and delete sorted set type data.
More Redis operation commands can
This is the CENTOS7 from the database mariadb, formerly MySQL, to 7 after the mariadb ...
1. MARIADB installation, no deep configuration ... Too lazy to move. Reference: http://blog.csdn.net/default7/article/details/41973887
A:yum Install
Edis backup and restore, with the help of a third party tool, Redis-dump1, install Redis-dump
The code is as follows
Copy Code
[Root@localhost tank]# yum install ruby rubygems ruby-devel/installation RubyGems and related
Install Reids
Redis Download Address: http://www.redis.io/download # wget http://download.redis.io/releases/redis-2.8.13.tar.gz # cd redis-2.8.13/# make zmalloc.o: in function ' zmalloc_used_memory ':/usr/local/
webserver/redis-2.8.13/src/zmalloc.
Introduction to collection types
The collection type is also a type that embodies redis a higher value. Because of the Redis collection type, we can easily perform difference set operations, intersection operations, and set operations in Redis.
An ordered set of types
Ordered set type, you should know from the name, in fact, is in the collection type added an order just. The ordered set type in the Redis, which is actually associated with a fraction for each element in the collection type,
Background:
In many applications of Internet products, some scenes need to be locked, such as: Second Kill, global increment ID, floor build and so on. Most of the solutions are based on DB, Redis for single process single-threaded mode, using
Use of SDSThe main functions of Sds in Redis are as follows: two.
Implements a String object (Stringobject);Used as a char* type of substitute within the Redis program;The following two subsections describe each of these two uses.
Implementing a
In Redis, if set maxmemory, it is necessary to configure the key recovery mechanism parameters Maxmemory-policy, default VOLATILE-LRU, see Redis author's original blog: Antirez weblog >> Redis As an LRU cache
It is clearly written in the original
Background
Developed a Redis data import tool using C + +Import all table data from Oracle into Redis;Not just data import, the original records in each Oracle, need to be processed by business logic,and add an index (Redis collection);When the
[Email protected] redis-3.0.5]# sh startredis6479.sh3103:m 08:35:52.773 * Increased maximum number of open files to 10032 (it is originally set to 1024)._.__.-' __ '-.__.-`` `. `_. "-._ Redis 3.0.5 (00000000/0).-`` .-```. ' \ \ _.,_ '-._(',.-' |
Redis official website address: Https://redis.io/;Redis The Windows environment is not supported for the time being, but Microsoft Open Tech Group has developed a version that runs under the Windows platform. Redis is an open source (BSD licensed),
Third, the program configurationin C # Redis Combat (ii) We have installed Redis's system services, and the Redis service is now running. now we need to let our program correctly read a series of configuration information such as Redis service
First, Redis IntroductionRedis is an open source, BSD-licensed, Advanced key-value (Key-value) cache and Storage (store) system. Because Redis keys include string,hash,list,set,sorted set,bitmap and Hyperloglog, they are often referred to as data
Info Server basic InformationMonitor live dump of received requestsFLUSHDB emptying the current databaseFlushall emptying all databasesQuit close ConnectionSave keeps data synchronized to diskBgsave AsynchronousLastsave returns the last timestamp
1. Install redis on the vps host① I use the LNMP package, which comes with redis. Execute./redis. sh to automatically install and add it to self-start② Install redis-server separately# Apt-get install redis-serverStart redis-server and add 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