windows10 configuration from the master copy redis

1, the installation from the server

A), to find redis example, copy out directly, as shown below

 

 b), modify the port number from the library, open the folder and find redis.windows.conf redis.windows-service.conf file from the library file, modify the port

 

 

After modifications are complete, cd to the installation directory from the library, you can connect using cmd from the library.

 

 But it also kind always need to boot cd to a folder, you need to set up as a service, the command is as follows:

redis-server --service-install redis.windows.conf --maxmemory 200m  --service-name redis6380

 

 

 2, the configuration from the master

a), can be used  SLAVEOF  command, master data will open with a swap of the old primary server synchronization, if the current server from the primary server has been dependent on the other, it will be lost between the slave, to the new primary server data synchronization, if you want to upgrading from a server-based server, use SLAVEOF  NO ONE can upgrade from a server to a master server, this command does not master-slave synchronization of data previously lost out.

 

 

 b), a permanent copy configuration

Open redis.windows.conf file, find the # slaveof <masterip> <masterport> this place, add slaveof ip address port

 

 test

 

 3, master-slave synchronization works

Each Redis master has a replication ID: This is a large pseudo-random string, marked a given data set. Each also holds an offset master, the master generates its own stream is transmitted to the replication Slave, sending the number of bytes of data, will increase its offset number, when a new object is to modify their operations the data set that can use this update slave state. Copy without offset even when a slave is connected to the master, will be incremented, so that substantially each given

Replication ID, offset

We will identify the exact version of a master data set.

When the slave connected to the master, transmits them to the old master replication ID and offset are processed so far their use PSYNC recording command. In this manner, master slave can transmit only the incremental portion required. But if it is master of the order backlog is not enough buffer recording, or if the slave is no longer referenced know history (replication ID), the full amount will instead be a resynchronization: In this case, slave will get a complete copy of the data set, start from scratch.

No need to copy disk participation

Under normal circumstances, the amount of a full resynchronization RDB asked to create a file on disk, then load it into memory from disk, and then slave in order to synchronize data.

If disk performance is very low, then it is a lot of pressure to master the operation. Redis 2.8.18 is the first to support diskless copy version. In this setting, the child is sent directly to the RDB file slave, without the use of an intermediate disk as a storage medium.

No Disk Copy can be used repl-diskless-sync configuration parameters. repl-diskless-sync-delay parameter may delay the start of the data transfer

Security Issues

If you open a master-slave replication, be sure to open the main from persistent server, if you do not open the persistence and the primary server is configured by default to start automatically, then when the primary server hung up, and then restart the primary server time, because there is no Configuring persistent, so this time the primary server is empty data set, this time to copy the data from the server the master server, find the primary server is empty, it will destroy its data from the server. This is very dangerous. So if not open persistence, then automatically start this service should be disabled

Guess you like

Origin www.cnblogs.com/zhaoyongjie-z/p/12556140.html