Tag:redis
-
Time:2021-1-29
This article mainly introduces the springboot redis distributed lock code example, through the example code is introduced in great detail, has a certain reference learning value for everyone’s study or work, need friends can refer to With the rapid development and application of distributed architecture such as microservice, in many cases, we will encounter the […]
-
Time:2021-1-19
1、 Preface Docker technology is very popular now. It is very efficient to build a project environment through containers. So recently, I took the time to read some tutorials, and then changed the blog deployment mode to docker. I don’t feel that there is any particularly good blog on the InternetdockerdeploydjangoProject tutorial, specially wrote this […]
-
Time:2020-12-8
When we do automatic discovery, there will always be a script to obtain port information and return it to JSON format. Take redis as an example. The following is the script for redis to perform automatic discovery redisport=(`ps aux|grep -w redis-server|grep -v “grep” |awk -F’:’ ‘{print $NF}’`) portnum=${#redisport[@]} count=`hostname | grep “\-SQ” | wc -l` […]
-
Time:2020-12-7
redis desktop managerIt is an open source redis visualization tool that can be used across platforms to help users easily and quickly view and manipulate the entire database. The software has an intuitive and powerful visual interface, and has a complete and comprehensive data operation function. It supports users to use the visual operation interface […]
-
Time:2020-12-7
preface In the learning process, it is found that the Zset of redis can also be used to realize the lightweight delayed message queuing function. Although the reliability needs to be improved, it can be realized for some functions that require less data reliability. This paper mainly uses zadd, zrangebycore and zdel in Zset of […]
-
Time:2020-11-10
POM file <! — redis dependency in springboot — > <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> to configure #Redis database index (default is 0) spring.redis.database=0 #Redis server address spring.redis.host=39.96.162.54 #Redis server connection port spring.redis.port=6379 #Redis server connection password (blank by default) spring.redis.password=qweqwe #Connection timeout (MS) spring.redis.timeout=0 Configuration class import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.context.annotation.Bean; import […]
-
Time:2020-10-31
This article mainly introduces how Python uses redis to build distributed locks. This article introduces in detail the example code, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it In the actual application scenario, we may have multiple workers, which may be in one machine […]
-
Time:2020-10-17
catalog [redis calls Lua Script] (ා redis calls Lua script) [redis + Lua realizes the real-time update of the rating list] (ා redis + Lua realizes the real-time update of the rating list) [Lua Script] (ා Lua script)Example of golang calling redis + LuaOptimization of conversion between byte slice and string Redis calls Lua script […]
-
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 […]
-
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 […]
-
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, […]
-
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 […]