Redis listens to a TCP port or UNIX socket to receive connections from clients. After a connection is established, redis performs the following operations internally:
First, the client socket is set to non-blocking mode because redis
Step one: Yum install redis -- install the redis Database Step two: Enable the redis service after the installation is complete. Service redis start Systemctl start redis. Service -- enable redis Service PS-Ef | grep redis -- check whether redis
Redis's key and value size restrictions today I studied how to serialize Java Beans to redis for storage. Suddenly my head is shining, will the object size exceed the redis limit? No matter what it is, it is better to clarify it, so I went to ask
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
Redis key)The redis key command is used to manage redis keys. Redis has a key for any data type--Redis command for deleting keys> Del key Redis transactionsRedis transactions can execute multiple commands at a time with the following three important
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.
Requirements:
If all data is saved to a redis instance, all services are affected if the server is damaged;
The memory size of a single apsaradb for redis instance should not exceed 1 GB. However, if the memory size is not modified, the data cannot
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
It can be understood as a hash set with sorting. The order is sorted from small to large based on the size of the score value. If the score value is the same, it is sorted by member.
// Insert a record to sort set, zadd zset1 10.2 val1zadd key
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. What is redis?
Redis is an open-source log-type, key-value database written in ansi c language that complies with the BSD Protocol, supports the network, and can be persistent based on memory, and provides APIs in multiple languages.1. redis
1. Go to the redis official website to download the redis compressed package https://redis.io/
2. Use the command mkdir/usr/local/redis to create a redis folder.
And move the redis compressed package to the new folder.
3. Decompress redis
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
#
I. Introduction to Sentinel
I used to talk about a wave of redis and its application scenarios. Today I tried his sentinel model;
Sentinel is a redis HA solution. A sentinel system consisting of one or more sentinel instances can monitor any number
1. if you install tcl8.6 directly, you will be prompted to update tcl8.6, so first install Tcl to the corresponding system version to view the Tcl full name apt-Get install tcl-dev2. install redis and decompress it to the root directory
Search for redis Images Using docker
docker search redisPull image to local
docker pull redisView the downloaded Image
docker imagesRun Image
docker run -p 6379:6379 -d redis
-pMap port 6379 of the container to port 6379 of the host.
-dRun the
Redis is a KV database with a complete set of memory. It does not have some data in the disk and some data in the memory. Therefore, it is very important to estimate and save memory in advance. this article describes how to estimate the memory
Preface first, post a reference link: http://www.redisbook.com/en/latest/internal-datastruct/adlist.html, also really like the author of the article, a guy after 90 really good, basic skills solid, the linked list is one of the core data structures
The preface project uses the redis data structure. I don't want to simply call the API. Here I will record my reading notes. Original article address: SDS:
// String type alias typedef char * SDS;
The other is sdshdr:
// Hold the structure of SDS
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.