Slave Replication) 详解(3)

diskless复制的延迟时间,防止设置为0。一旦复制开始,节点不会再接收新slave的复制请求直到下一个rdb传输。所以最好等待一段时间,等更多的slave连上来。

#当启用无磁盘复制时,可以配置服务器等待的延迟,以便产生子进程,通过socket传输RDB给slaves。

# This is important since once the transfer starts, it is not possible to serve

# new slaves arriving, that will be queued for the next RDB transfer, so the server

# waits a delay in order to let more slaves arrive.

#这是很重要的,因为一旦传输开始,不可能服务新到达的slaves,它们将为下一个RDB传输排队,所以服务器等待一段时间,以便让更多的slaves到达。

-------------------------------------

# The delay is specified in seconds, and by default is 5 seconds. To disable

# it entirely just set it to 0 seconds and the transfer will start ASAP.

# 延迟以秒为单位指定,默认值为5秒。要完全禁用它,仅仅设置为0秒即可,传输将尽快开始。

repl-diskless-sync-delay 5

# Slaves send PINGs to server in a predefined interval. It's possible to change

# this interval with the repl_ping_slave_period option. The default value is 10

# seconds.

#slaves以预定义的时间间隔向服务器发送PING。可以使用repl_ping_slave_period选项更改此时间间隔。默认值为10秒。

#

# repl-ping-slave-period 10

-------------------------------------------

复制连接超时时间。master和slave都有超时时间的设置。master检测到slave上次发送的时间超过repl-timeout,即认为slave离线,清除该slave信息。slave检测到上次和master交互的时间超过repl-timeout,则认为master离线。需要注意的是repl-timeout需要设置一个比repl-ping-slave-period更大的值,不然会经常检测到超时。

# The following option sets the replication timeout for: 设置复制timeout

#

# 1) Bulk transfer I/O during SYNC, from the point of view of slave. 从slave角度看,批量传输I / O在SYNC期间。

# 2) Master timeout from the point of view of slaves (data, pings).  从slave角度看,master 超时(data,pings)

# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). 从masters角度看,slave超时(REPLCONF ACK pings)

#

# It is important to make sure that this value is greater than the value

# specified for repl-ping-slave-period otherwise a timeout will be detected

# every time there is low traffic between the master and the slave.

#重要的是确保此值大于为repl-ping-slave-period指定的值,否则每次master和slave之间的流量低时都会检测到超时。

#

# repl-timeout 60

-------------------------------------------

是否禁止复制tcp链接的tcp nodelay参数,可传递yes或者no。默认是no,即使用tcp nodelay。如果master设置了yes来禁止tcp nodelay设置,在把数据复制给slave的时候,会减少包的数量和更小的网络带宽。但是这也可能带来数据的延迟。默认我们推荐更小的延迟,但是在数据量传输很大的场景下,建议选择yes。

# Disable TCP_NODELAY on the slave socket after SYNC? SYNC之后在slave socket上禁用TCP_NODELAY?

#

# If you select "yes" Redis will use a smaller number of TCP packets and

# less bandwidth to send data to slaves. But this can add a delay for

# the data to appear on the slave side, up to 40 milliseconds with

# Linux kernels using a default configuration.

#如果选择“是”,Redis将使用较少数量的TCP数据包和较少带宽将数据发送到从站。但是这可能会增加数据出现在对端slave上的延迟,对于Linux内核,使用默认配置可以延迟40毫秒。

# If you select "no" the delay for data to appear on the slave side will

# be reduced but more bandwidth will be used for replication.

#如果选择“否”,数据在slave端出现的延迟将减少,但更多的带宽将用于复制

# By default we optimize for low latency, but in very high traffic conditions

# or when the master and slaves are many hops away, turning this to "yes" may

# be a good idea.

#默认情况下,我们针对低延迟进行优化,但在非常高的流量情况下,或者当master和slave相隔许多跳时,将其转换为“yes”可能是个好主意。

repl-disable-tcp-nodelay no

---------------------------------------

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/58b3b5a4db60b2caeb1fbc689fc5c447.html