current location:Home > Technical Articles > Database > Redis

  • How to install Redis under Linux
    How to install Redis under Linux
    Redis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of keyvalue storage such as memcached, and can play a very good supplementary role to relational databases in some situations. Installation environment Redis version 5.0.4 Server version Linux CentOS 7.64-bit Linux Specific steps to install Redis Download Redis Go to the official website and find the download address https://redis.io/download Right-click the Download button and select Copy link. Enter the Xshell console (the default is the root directory), enter wget to paste the download link copied above
    Redis 1411 2023-05-27 19:42:42
  • What are the two implementation solutions for Redis high availability?
    What are the two implementation solutions for Redis high availability?
    In order to achieve high availability (HA) in Redis, the following two methods are used: master-slave replication of data. Sentinels are used to monitor the operation of data nodes. Once a problem occurs on the master node, the slave node continues to provide services. Master-slave replication In Redis, data replication between master-slave nodes can be divided into full replication and partial replication. The full replication function of the old version is implemented using the snyc command. The process is: the slave server sends the sync command to the master server. After receiving the sync command, the master server calls the bgsave command to generate the latest rdb file, and synchronizes this file to the slave server. In this way, after the slave server loads the rdb file, the status will be the same as that of the master server.
    Redis 1120 2023-05-27 19:42:12
  • How to solve the stress test error when springboot inherits redis
    How to solve the stress test error when springboot inherits redis
    When using jmeter for pressure testing, the error message is an off-heap memory overflow:
    Redis 1136 2023-05-27 19:19:04
  • How does springboot integrate redis to modify partitions
    How does springboot integrate redis to modify partitions
    Springboot integrates redis to modify the partition problem. Recently, springboot is integrated with redis. A system dynamic data source connects to different databases and caches the redis used. Then the data of different databases needs to be cached in different partitions of redis, that is, different libraries. Old version solution The old version here refers to the one before 2.0, and the 1.5.9 I used is ok. The redis configuration class will not be posted here, there are many online. 1. Use JedisConnectionFactory to modify @AutowiredJedisConnectionFactoryjedisConnectionFactory;j
    Redis 1237 2023-05-27 19:16:10
  • How springboot uses Redis for caching
    How springboot uses Redis for caching
    1.依赖与数据库设置org.springframework.bootspring-boot-starter-data-redisorg.apache.commonscommons-pool2org.springframework.bootspring-boot-starter-weborg.springframework.sessionspring-session-data-redisorg.springframework.bootspring-boot-starter-testtestspri
    Redis 1078 2023-05-27 19:04:04
  • Example analysis of linux environment deployment and docker installation of redis
    Example analysis of linux environment deployment and docker installation of redis
    Installation steps 1. Install redis and download the redis image through dockersearchredis and dockerpullredis 2. Create a new mounting configuration folder. Create two folders, data and conf, in any location. mkdir-p/root/docker/redis/datamkdir-p/root/docker/redis/conf Note: Because of the default configuration of redis, you will find that you can only connect locally and cannot access remotely. If you use redisdesktopmanager to connect, an error will be reported, so you need to manually hang it. Load the redis configuration file 3. Add the configuration file redis.conf just now
    Redis 1281 2023-05-27 18:24:42
  • How to deploy redis cluster
    How to deploy redis cluster
    1. Redis master-slave architecture 1.1. Master-slave replication principle The slave server connects to the master server and sends the PSYNC command; after the master server receives the PSYNC naming, it starts executing the BGSAVE command to generate the RDB file and uses the buffer to record all write commands executed thereafter; the master server After the server BGSAVE is executed, it sends snapshot files to all slave servers and continues to record the executed write commands during the sending process; after receiving the snapshot file, the slave server discards all old data and loads the received snapshot; the master server snapshot is sent. Then start sending write commands in the buffer to the slave server; the slave server completes loading the snapshot, starts receiving command requests, and executes write commands from the master server buffer; (slave server initialization is completed) the master
    Redis 1196 2023-05-27 18:05:50
  • How does php enable the Swoole/Pool process pool to implement Redis persistent connections?
    How does php enable the Swoole/Pool process pool to implement Redis persistent connections?
    PHP allows the Swoole|Pool process pool to implement the Redis persistent connection process pool, which is implemented based on the Manager management process module of Swoole\Server. It can manage multiple work processes. Compared with Process to implement multiple processes, Process\Pool is simpler and has a higher encapsulation level. Developers can implement process management functions without writing too much code. With Co\Server, pure coroutine style can be created. , a server-side program that can utilize multi-core CPUs. Swoole process pool implements redis data reading in the following case. Start the Redis process pool through WorkerStart and read the Redis list data persistently; when WorkerStop is disconnected
    Redis 1133 2023-05-27 17:55:12
  • How to install redis-dump tool
    How to install redis-dump tool
    The redis-dump tool is used to build the environment for data migration in the cluster: 192.168.19.201redis-cluster637970017002rvmredis-dump192.168.19.202redis-cluster637970017002192.168.19.203redis-cluster637970017002 due to the installation of the redis-dump tool You need to use rvm and gem tools, so they must be installed in advance. 1. Install the dependency packages required to install rvm and other tools in advance #yum-yinstallzlibzlib-develpcrepcre
    Redis 1846 2023-05-27 17:52:12
  • How to use Java to operate Redis database
    How to use Java to operate Redis database
    Redis is a memory-based database that interacts with Redis to greatly improve the speed of operation. First, let us create an ordinary Maven project, add the corresponding dependency redis.clientsjedis3.3.0com.alibabafastjson1.2.72 and then we can use the test connection (here I use the local reids service) // define the host number, Port number HostAndPorthostAndPort=newHostAndPort("127.0.0.1",6379);//Connect the redis service Jedisjedis=ne
    Redis 1035 2023-05-27 17:52:06
  • Example analysis of Redis's zmalloc function
    Example analysis of Redis's zmalloc function
    Let's look directly at the custom zmalloc function in the Redis source code (not the latest version). This function is used in exactly the same way as regular functions such as malloc. The difference lies in its internal implementation details. void*zmalloc(size_tsize){//Allocate memory; void*ptr=malloc(size+PREFIX_SIZE);//Allocation failure throws an exception; if(!ptr)zmalloc_oom_handler(size);//Can the system use "malloc_size" function? #ifdefHAVE_MALLOC_SIZEupdate_zmalloc
    Redis 1153 2023-05-27 17:50:40
  • How to implement responsive Redis interaction in Spring
    How to implement responsive Redis interaction in Spring
    This article will simulate a user service and use Redis as the data storage server. Involving two javabeans, users and rights publicclassUser{privatelongid;privateStringname;//label privateStringlabel;//receiver address longitude privateDoubledeliveryAddressLon;//receipt address dimension privateDoubledeliveryAddressLat;//latest sign-in day privateStringlastSigninDay;//points privateIntege
    Redis 1188 2023-05-27 17:49:47
  • What are the knowledge points of Redis ordered set zset?
    What are the knowledge points of Redis ordered set zset?
    The redis ordered collection zset is very similar to the ordinary collection set. It is a string collection without repeated elements. The difference is that each member of an ordered set is associated with a score, and this score is used to sort the members of the set from the lowest score to the highest score. The members of the set are unique, but the ratings are repeatable. Because the elements are ordered, you can quickly get a range of elements based on score or position. Accessing intermediate elements in a sorted set is also very fast, since you can use the sorted set as a smart list without duplicate members. zadd: add element zrange:score
    Redis 1146 2023-05-27 17:23:00
  • How to solve the problem of redis expiration time
    How to solve the problem of redis expiration time
    1. How to modify a redis' String expiration key multiple times to ensure that it can still retain the deletion time when it was first set. For modifying String, redis has: set, setex, append, incr, decr, etc. Among them, use set and setex To modify the original existing String, the originally set expiration time will be reset. Strictly speaking, set and setex are not "modifications", but overwriting, so the originally set key-value will be overwritten by set/setex again. Drop the original one. The test results using tryredis are as follows: If you use append, incr, decr and other commands to modify, it will not be repeated.
    Redis 2157 2023-05-27 16:49:19
  • What is the concept of Redis cache penetration and cache avalanche
    What is the concept of Redis cache penetration and cache avalanche
    1. Cache penetration 1. Concept The concept of cache penetration is very simple. The user wants to query a data and finds that the redis memory database does not have it, that is, the cache does not hit, so it queries the persistence layer database. It was found that there was none, so this query failed. When there are many users, the cache does not hit, so they all request the persistence layer database. This will put a lot of pressure on the persistence layer database, which is equivalent to cache penetration. Here you need to pay attention to the difference from cache breakdown. Cache breakdown means that a key is very hot and is constantly carrying large concurrency. Large concurrency focuses on accessing this point. When the key fails at the moment, it continues to Large concurrency breaks through the cache and directly requests the database, which is like cutting a hole in a barrier.
    Redis 760 2023-05-27 16:35:20

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28