Next: Installation of the Redis,redis Visual management tool (Redis Desktop Manager) under Windows Setup, Basic use, instantiation of the project
I. How the Dump.rdb file was generated
Ii. What is Redis persistence
Iii. What is the RDB for Redis?
Iv. Redis configuration file redis.config related configuration
V. Advantages of Redis
Vi. shortcomings of Redis
Redis is more powerful than memcache as a cache
This article from the @ where the fun technology Pesiwang classmate contribution to share, Redis Rdb file persistence of the internal implementation of the source code analysis.
This article analyzes the source code based on Redis 2.4.7 stable version. The following is the original article:
RDB is one way in which Redis saves memory data to disk data (the other is aof). The main principle of
Tags: Redis RDB AOF1. Introduction to RedisRedis is an advanced Key-value database. It is similar to memcached, but the data can be persisted and the supported data types are rich. There are strings, lists, collections, and ordered collections. Supports the addition, intersection and complement (difference) of the compute sets on the server side, and supports a variety of sorting functions. So Redis can als
finished processingParent process replaces old files with new Dump.rdbAttention:When fork occurs, the parent-child process memory is shared, so in order to not affect the child process to do the data snapshot, during this time the modified data will be copied one copy, not into the shared memory . So, thedata persisted by R DB is the data when the fork occurs . Persist data under such conditions and lose data for a period of time if it is down due to certain circumstances . If your situation is
Chapter One: tree structure data in an RDBIn this chapter, I will write a basic knowledge to understand the problemThe role of a modelThe function of RBD processing tree model is summarized as two points:
1 saving data for a tree in an RDB table
2 related nodes of the query node for efficiency
1 saving data for a tree in an RDB tableWe can define the criteria for whether the model has the
Redis provides an RDB persistence mechanism that writes a snapshot of an in-memory dataset to disk within a specified time interval.Advantages of the RDB:1, in this way, backup Redis database only one file, once the system has a catastrophic failure, can be very easy to recover.2, you can easily transfer a compressed backup file to other secure storage media.3, m
An RDB is another form of persistence for Redis, which is equivalent to a timed snapshot and also to the snapshot +redo log in master-slave synchronization. Redis does not require a lock when it makes an RDB, which is done by using the parent-child process to share the same memory. After the parent process fork the child process, the parent and child share the same physical memory copy-on-write, and the mem
Redis Persistence-rdbThe persistence of Redis is divided into rdb persistence and aof persistence, and this article mainly says about RDB persistence related things.
RDB persistence is the process of saving data from the current Redis database to the hard disk.
Trigger TimeThere are two ways to trigger an
10.1 Rdb file creation and onboardingThere are two Redis commands that can be used to generate an RDB file, one for save and the other for Bgsave.The Save command blocks the Redis server process until the Rdb file is created.The Bgsave command will derive a Zi Jin Chengguan responsible for creating the Rdb file, and th
Configuration process
The default snapshot mode is on, and Redis writes the snapshot to the Dump.rdb (default name) file according to the snapshot Save policy,which can be set in the configuration file, which is the dir configuration item. The default save policy is as follows:650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/83/F6/wKiom1eB6bWDp-HeAADtJPCnTYQ779.jpg-wh_500x0-wm_3 -wmp_4-s_4223182470.jpg "title=" 1.jpg "alt=" Wkiom1eb6bwdp-heaadtjpcntyq779.jpg-wh_50 "/>The command
backup of the current database, which will create a Dump.rdb file under the Redis installation directory dir.If you need to recover data, simply move the backup file Dump.rdb to the Redis installation directory and start the service. Get the Redis directory using the config get dir command(2) Bgsave is executed in the background;(3) Shutdown save, when the service is closed, shutdown has two options, nosave|save, if not added, the default is save;Aut
Label:Background: Production of a Redis server, physical memory 32G, several projects are in use, often less than a month memory will be exhausted, and then start to use Swap, when the swap is exhausted, the system will go down. The Redis configuration has also been optimized several times, but no results have been achieved. So I decided to look at the memory size of the Redis storage data to see if there are any abnormal data.First, install redis-rdb
The AOF saved data scheme is the most complete, if both RDB and aof are turned on, the AoF method is used.
(1) Save rules for setting data to a data file
Save 1 #900秒时间, at least one data update, save to the data file #300秒时间, at least 10 data updates, save to the data file in Save 10000 #60秒时间, at least 10,000 data updates , it is saved to the data file
(2) Data RDB compression settings
Rdbcompression Ye
Ii. advantages and disadvantages of the RDB mechanism:What are the advantages of an RDB?1). Once this is used, your entire Redis database will contain only one file, which is perfect for file backups. For example, you might want to archive the last 24 hours of data every hour and archive the last 30 days of data every day. With such a backup strategy, we can reco
The following begins the creation of an RDB for mailbox recoveryExecute the following command to create a recovery database named EDB01 and connect to the database and logs in our recovered dataWhere-edbfilepath specifies the database file for the database that we have just
1,misconf Redis is configured to save the RDB snapshots, but was currently not able to persist on disk. Commands that may modify the data set is disabled. Please check your Redis logs for details about the error.
Reason: The Redis snapshot should have been previously forced to stop causing
Solution:
Config set Stop-writes-on-bgsave-error no
(Linux) does not start with Root, with the app user (no maximum permissions) force shutdown, after the command
(Error) Misconf Redis is configured to save the RDB snapshots, but was currently not able to persist on disk.There was an error running Redis today with the following error message:(Error) Misconf Redis is configured to save the RDB snapshots, but was currently not able to persist on disk. Commands that may modify the data set is disabled. Please check your Redis logs for details about the error.Redis is co
the solution: //Original:http://pydelion.com/2013/05/27/redis-cant-save-in-background-fork-cannot-allocate-memory/If you get ThisError Can' t save in Background:fork:Cannot allocate memoryIt means that your the current database is bigger than memory. To fix the issue enable Vm.overcommit_memory:sysctl Vm.overcommit_memory=1 to hasifAfter rebootAdd this line to /etc/ sysctl.cnf: vm.overcommit_memory
=1 The problem is solved after modify
Redis's excellent performance is because it stores all the data in memory, the same memcached do, but why Redis can stand out, largely because Redis has excellent persistence mechanism to ensure that the server restart, the data will not be lost. Here's a look at how Redis is persisted.
Redis supports the persistence of two ways, one is the RDB way, the other is the AOF way. Either of these can be used individually or in a mixed way.
Introduction of
Tags: server database binary recordWhen you import data to Redis, there are times when Redis server went away occurs, and this problem occurs for the following reasons:
The amount of data being imported is too large, not enough memory (that is, memory 1G, but the data has 2G). The Redis service needs to be restarted at this time.
There may be too much data being imported at the same time, causing problems with data persistence, and the
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.