Category:Redis

  • Win10 configuration redis service implementation process

    Time:2020-10-19

    1、 Windows installation: Download address: https://github.com/MicrosoftArchive/redis/releases/tag/win-3.2.100 (there is no window version on redis official website, so it needs to be downloaded from GitHub); Install redis-x64-3.2.100.msi, and double-click the newly downloaded MSI format installation package (redis-x64-3.2.100. MSI) to start the installation. Select agree agreement and click next to continue. Select “add redis directory to environment variable […]

  • Handling method of redis connection timeout exception

    Time:2020-10-18

    0. Problem description Using jedis to connect to redis for data query operation, the normal code operation is OK, but the following errors will be reported from time to time: Exception in thread “main” redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out  at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:202)  at redis.clients.util.RedisInputStream.read(RedisInputStream.java:181)  at redis.clients.jedis.Protocol.processBulkReply(Protocol.java:181)  at redis.clients.jedis.Protocol.process(Protocol.java:155)  at redis.clients.jedis.Protocol.processMultiBulkReply(Protocol.java:206)  at redis.clients.jedis.Protocol.process(Protocol.java:157)  at redis.clients.jedis.Protocol.processMultiBulkReply(Protocol.java:206)  at redis.clients.jedis.Protocol.process(Protocol.java:157) […]

  • Installation and test of redis on MacOS

    Time:2020-10-17

    About redis Redis is a key value database with high performance and free of charge and BSD protocol. Redis runs in memory and supports data persistence. It can save the data in memory on the disk. It can be loaded again for use when restarting. Redis not only supports simple key value data, but also […]

  • Use redis to get data and transfer it to JSON to solve the problem of dynamic generic parameter transfer

    Time:2020-10-16

    Scene: There are two roles in the project that require different login permissions. Redis is used as the user login information cache database. Code is a method to obtain the corresponding data according to different user entity types. The user entities are: sessionentity < user1 >, sessionentity < user2 >. JSON uses fastjson. First of […]

  • Redis solves the key garbled problem and cleans up the detailed explanation

    Time:2020-10-15

    Key garbled code problem Since redis uses the jdkserializationredisserializer by default, the key is garbled, as follows: keys ‘*!report:flag:phon*’ 1) “\xac\xed\x00\x05t\x00!report:flag:phone_156464” 2) “\xac\xed\x00\x05t\x00!report:flag:phone_198946” 3) “\xac\xed\x00\x05t\x00!report:flag:phone_183302” Solve key garbled code private RedisTemplate redisTemplate; @Autowired(required = false) public void setRedisTemplate(RedisTemplate redisTemplate) { RedisSerializer stringSerializer = new StringRedisSerializer(); redisTemplate.setKeySerializer(stringSerializer); redisTemplate.setValueSerializer(stringSerializer); redisTemplate.setHashKeySerializer(stringSerializer); redisTemplate.setHashValueSerializer(stringSerializer); this.redisTemplate = redisTemplate; } Clean up […]

  • Record of scan command in redis

    Time:2020-10-14

    1、Originally I thought I was quite familiar with the redis command. Various data models and various operations based on redis. But recently, when I used the command mode of redis scan, I suddenly found that my original understanding of the cursor of redis was very limited. So record the process of stepping on the pit, […]

  • Redis cluster solution

    Time:2020-10-13

    Some time ago, we set up a redis cluster and wanted to use it as online storage for the recommendation system. It’s interesting to say that the infrastructure here is not perfect. Therefore, we need to build this storage environment by ourselves as the recommender system, and we have a lot of trouble. The awesome […]

  • Redis cluster details

    Time:2020-10-11

    Redis cluster details Redis has three cluster modes, namely: *Master slave mode *Sentinel mode *Cluster mode Each of the three cluster modes has its own characteristics. For the introduction of redis, you can refer to NoSQL (2) – redis Redis official website: https://redis.io/ , latest version 6.0.5 Master slave mode Introduction of master slave modeMaster […]

  • The realization method of converting audio files into binary packets and storing them in redis

    Time:2020-10-10

    Functional requirements: 1、 Get the local audio file and parse it into binary data audio stream 2、 The audio stream is converted into a byte [] array, and the packet is carried out according to the number of bytes of the specified size 3、 The audio stream is divided into several packets and cached in […]

  • Detailed analysis on the source code of redis network model

    Time:2020-10-9

    preface The network model of redis is based on I / O multiplexing program. The source code contains four multiplexing function libraries epoll, select, evport and kqueue. When the program is compiled, one of the four libraries will be automatically selected according to the system. Take epoll as an example to analyze the source code […]

  • The keys command of redis must not be misused

    Time:2020-10-8

    Kesy command Time complexity: O (n). Suppose that the key name in redis and the length of the given schema are limited, n is the number of keys in the database. The redis keys command is used to find all keys that match a given pattern Although the time complexity of this operation is O […]

  • Details of sentinel, a high availability component of redis service

    Time:2020-10-7

    In the previous article, we learned about the use and description of the commonly used data types of redis. Please refer to the https://www.jb51.net/article/120364.htm Today, let’s talk about sentinel, a highly available component of redis. First of all, we will review the master-slave synchronization of redis. The main function of master-slave synchronization is to make […]