Installation:1. Get Redis Resourceswget http://download.redis.io/releases/redis-4.0.8.tar.gz2. UnzipTar xzvf redis-4.0.8.tar.gz3. InstallationCD redis-4.0.8MakeCD srcMake install Prefix=/usr/local/redis4. Move the configuration file to the
Redis startup and management in a Linux environmentCommand under the Redis root directoryQuick Start default port./redis-server. /redis.confStart the Redis management side./redis-cliCleanup Cache Command FlushallConfigure additional Redis ports :1,
54945667Does Redis need to set the maximum memory consumption? What if the Redis memory usage exceeds the set maximum value?Set Redis maximum memory consumptionRedis sets the maximum memory footprint, opens the Redis profile, finds the following
InstallationOne, decompression source installation package, through TAR-ZXVF redis-3.0.2.tar.gz decompression source;#cd/usr/local/software/#tar-ZXVF redis-3.0.2.tar.gzSecond, enter the extracted directory, execute make compile source code;When the
Asynchronous operations are cumbersome. Difficult to control. The following is a synchronized library Bluebird. The usage is simple. Look at you and you'll know.Const REDIS = require (' Redis ');Const BLUEBIRD = require (' Bluebird
Accidentally found an interface in the code, the interface definition is paged query, but the logical implementation is redis. Don't quite understand, how does Redis split pages? Later I saw an article, and then I learned it.1, Zrevrange
1.Clustereven with master-slave replication , each database holds all the data in the entire cluster, making it easy to create a cask effect.Use Jedis implements a shard cluster , which is the client's control over which key data is saved to which
Zset Features:Like set set, ordered, element is a string, each element is associated with a floating point value, and in the order of the score from small to largezadd: Add one or more elementsZadd Key [nx| XX] [CH] [INCR] score member [score member
Redis data types are all key-value pairs. The data type should be the value data type, such as string, set, list, etc., are the data set format of the value corresponding to the key value.The difference between different data types is that the
Recently, alicloud is preparing for the next interview, including redis and redis as the key content. Redis is an open-source log-type and key-value database written in ansi c language that supports Network, memory-based persistence, and provides
1. From the storage medium, its data is stored in the memory, which is quite fast. Similar to hashmap, it also exists in the memory.2. The storage of set key values is very simple, which means fast.3. reids are single-threaded and single-process.
Redis: What is redis:
Remote dictionary server (Remote dictionary server)
It is completely open-source and free. It is written in C language and complies with the BSD Protocol. It is a high-performance (key-value) distributed memory database.
Nosql
Redis Basic Data Type
Redis currently supports five data types:
String (string)
List)
Hash (dictionary)
Set)
Sorted set)
The following describes the five data types and their corresponding operation commands.
String (string)
String is a simple
1. What is redis?
Redis is a nosql (also a huge map) single thread, but it can process concurrent requests per second (data is in the memory)
Using Java to operate redis is similar to the JDBC interface standard for MySQL. There are various
I. Overview
Cluster is supported after redis3.0.
1.1 redis cluster status quo
Currently, redis supports the following cluster features:
1): Automatic Node Discovery
2): slave-> master election, cluster Fault Tolerance
3): Hot resharding: Online
Cluster Management Tool redis-trib.rb has been abandoned, so do not need to install Ruby what, at that time the redis-trib.rb function, now has been integrated into redis-CLI, can pass. /redis-cli -- cluster help to view the usage.
Environment
#
1. Download the tar package
redis-3.2.8.tar.gz
2. decompress the package to the specified directory.
sudo tar -xzvf redis-3.2.8.tar.gz -C /soft
3. Install the GCC compiler
sudo yum install -y gcc
4. Compile and install redis
$> Su root $> Cd ~
I. background
1. aof:
Redis's aof mechanism is a bit similar to MySQL BINLOG, which is a persistent method provided by redis (the other is RDB). It will write all the commands at a certain frequency (no, always, every seconds) is written to the
Redis command Chinese manual
I. Base
Del
Delete a key or a series of keys; del key1 key2 key3 key4
Type
Returns the Data Type of a key element (none: nonexistent, string: character, list, set, zset, hash)
Keys
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