redis.config翻译

# Redis configuration file example
#redis配置文件范例

# Note on units: when memory size is needed, it is possible to specify
#注意单位:当内存大小需要被使用的时候,它可以被指定。
# it in the usual form of 1k 5GB 4M and so forth:
#这个是在1k 5G 4M的常见配置等等。
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.
# 配置单位在对1GB 1Gb 1bG这种大小写认为是相同的,不敏感。

################################## INCLUDES (包含)###################################

# Include one or more other config files here. This is useful if you
# have a standard template that goes to all Redis servers but also need
# to customize a few per-server settings. Include files can include
# other files, so use this wisely.
#包含一种或者多种其他的配置文件在这里,如果你有一个标准的模版给所有的redis服务器,
#还需要定制一些每台服务器配置,这是是有非常有用的。
#包括的文件包含其他文件,所以使用这个是明智的。
#
# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
# from admin or Redis Sentinel. Since Redis always uses the last processed
# line as value of a configuration directive, you'd better put includes
# at the beginning of this file to avoid overwriting config change at runtime.
# 注意选择“包含”来至admin或者是redis传送的命令不能写入“配置写入”。
#redis总是使用最后线程值来配置指令的值,你最好包含这个文件的开头,避免覆盖配置来改变运行时的变化。
# If instead you are interested in using includes to override configuration
# options, it is better to use include as the last line.
# 相反,如果你有兴趣使用包含重写配置选项,更好的使用包含作为最后的防线。
# include .\path\to\local.conf
# include c:\path\to\other.conf
#包含

################################ GENERAL #####################################

# On Windows, daemonize and pidfile are not supported.
# However, you can run redis as a Windows service, and specify a logfile.
# The logfile will contain the pid.
#在windows上,加密选项和进程文件不能支持。
# 然而,你在window服务上运行redis,指定日志文件, 日志文件必须包含在进程中。

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379
#接收指定端口的连接,默认是6379
#如果指定端口0是指定的redis则不能监听TCP socket

# TCP listen() backlog.
#
# In high requests-per-second environments you need an high backlog in order
# to avoid slow clients connections issues. Note that the Linux kernel
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# in order to get the desired effect.
tcp-backlog 511

#tcp监听 备份日志
#在每秒高要求的环境中,你需要为了避免缓慢的客户端连接出现问题的高积压。
#需要注意的是Linux内核会默默地它截断在程序/系统/网络/核心/接口 在正确提升多个值在最大连接数和最大tcp同步备份日志。

# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# interfaces using the "bind" configuration directive, followed by one or
# more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1

#默认redis监听的连接来至所有可用的服务器上的网络接口连接,
#使用“绑定”配置指令进行合理的监听一个或者多个端口,还有一个或者更多IP地址。
#例子


# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /tmp/redis.sock
# unixsocketperm 700

#指定unix socket路径将使用监听传入连接,没有默认
#当没有指定redis将不会监听unix的socket

#unixsocket 文件地址
#unixsocket端口

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
#当一个客户端超时N秒之后再关闭连接(0即关闭)

# TCP keepalive.
# TCP保持连接
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
# of communication. This is useful for two reasons:
# 如果非0,则使用保持连接发送TCP ACK(确认)给客户端断开通讯,有下面两个因素。
# 1) Detect dead peers.
# 2) Take the connection alive from the point of view of network
# equipment in the middle.
# (1)查明断开的伙伴 (2)从网络中的每个点获取活的连接。
# On Linux, the specified value (in seconds) is the period used to send ACKs.
# Note that to close the connection the double of the time is needed.
# On other kernels the period depends on the kernel configuration.
#在linux,规定的时间内(秒)发送ACKs(应答请求)。
#注意关闭这个连接需要双倍的时间。在其他内核的周期取决于内核配置。
# A reasonable value for this option is 60 seconds.
tcp-keepalive 0

#一个合理的值的选项是在60秒。


# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice

#注意服务器亢余的级别。
#可以是以下之一:
#调试(大量的信息,开发/测试有用)
#亢余(很多很少用到的数据信息,但是不会像debug那样杂乱。)
#注意(你在生产中可能会存在适当的数据亢余)
#警告(只有在非常重要/关键的消息记录)
#注意的日志范围

# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output.
logfile "Logs/redis_log.txt"

#注意日志文件名称,“输出”可以迫使redis日志标准化的输出。

# To enable logging to the Windows EventLog, just set 'syslog-enabled' to
# yes, and optionally update the other syslog parameters to suit your needs.
# If Redis is installed and launched as a Windows Service, this will
# automatically be enabled.
syslog-enabled yes
#允许日志可以记录到windows事件日志。
#只要设置"系统日志启用",你需要选择性的更新其他系统日志参数,已满足你的需求。
#如果redis安装并且启动作为windows服务,他将会自动启用。


# Specify the source name of the events in the Windows Application log.
syslog-ident redis
#指定这个事件根源来说window应用日志的来源名称。

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16
#设置数据库数量,默认的数量是为0,
#你可以查询不同的数据库之间的连接的基础是使用查询,其中dbid的值在0和-1


################################ SNAPSHOTTING(快照) ################################
#
# Save the DB on disk:
#
# save <seconds> <changes>
#
# Will save the DB if both the given number of seconds and the given
# number of write operations against the DB occurred.
#
# In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
#
# Note: you can disable saving completely by commenting out all "save" lines.
#
# It is also possible to remove all the previously configured save
# points by adding a save directive with a single empty string argument
# like in the following example:
#
# save ""
#在硬盘上保存数据库
#保存<秒>(改变)
#如果在数据库中进行很多秒且大量数据写入操作将会进行保存。

#下面行为的例子将进行保存:
#如果至少一个键改变了之后的900秒(15分钟)。
#如果10个键改变了那么之后的300秒进行保存(5分钟)
#如果1000个主键改变之后60秒保存。

#注意:你关闭完全保存来进行屏蔽所有的“保存”
#也可以通过添加一个保存指令与像在下面的例子中一个空字符串参数删除所有以前配置的保存点:

save 900 1
save 300 10
save 60 10000

# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
# This will make the user aware (in a hard way) that data is not persisting
# on disk properly, otherwise chances are that no one will notice and some
# disaster will happen.
#
# If the background saving process will start working again Redis will
# automatically allow writes again.
#
# However if you have setup your proper monitoring of the Redis server
# and persistence, you may want to disable this feature so that Redis will
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.
stop-writes-on-bgsave-error yes

#默认的redis会禁用接收写入的快照数据(最小的一个保存点)让后台保存不能保存。
#这个可以让使用者(通过手动的方式)把数据持久化到硬盘上,否则注意一些灾难会发生时将会很麻烦。
#如果开启保存的后台程序再一次启动redis自动得写入。
#然而如果你安装适当的持续的监听redis服务器持久化可能要禁用这个功能,这样的redis将继续像往常一样工作,即使有磁盘问题.权限,等等。


# Compress string objects using LZF when dump .rdb databases?
# For default that's set to 'yes' as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes

#当存储关系型数据库的时候使用LZF压缩字符串对象,对于默认是"yes",这个几乎总是有双赢。
#如果你想要节省一些CPU性能将其设置为"no",但是如果你不压缩值或者键,这个数据集将会很大。


# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
# This makes the format more resistant to corruption but there is a performance
# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
# for maximum performances.
#
# RDB files created with checksum disabled have a checksum of zero that will
# tell the loading code to skip the check.
rdbchecksum yes

#版本5之前的关系型数据是一个rc64算法校验被放置在文件结尾。
#这个可以格式化脏数据,但是当保存和加载关系型数据库文件的时候,这样执行命中的数据的概率大约10%,所以你可以禁用这个最大的性能。
#关系型文件被创建和禁用判断检验则会生成一个检验数量为0的,这个加载代码的时候可以跳过检查。

# The filename where to dump the DB
dbfilename dump.rdb

#当存储数据所需的文件名称

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./

#工作的文件夹
#该数据库将被写入这个目录里面,有指定的文件名上面使用“数据库名”的配置指令。
#追加只读文件在这个目录内被创建。
#注意你必须指定一个目录,而不是一个文件名。

 

################################# REPLICATION(复制) #################################

# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. A few things to understand ASAP about Redis replication.
#
# 1) Redis replication is asynchronous, but you can configure a master to
# stop accepting writes if it appears to be not connected with at least
# a given number of slaves.
# 2) Redis slaves are able to perform a partial resynchronization with the
# master if the replication link is lost for a relatively small amount of
# time. You may want to configure the replication backlog size (see the next
# sections of this file) with a sensible value depending on your needs.
# 3) Replication is automatic and does not need user intervention. After a
# network partition slaves automatically try to reconnect to masters
# and resynchronize with them.
#
# slaveof <masterip> <masterport>

#主设备复制,使用从服务器在redis复制数据到其他服务器,有几个事情要尽快了解有关redis复制。
#(1)redis复制操作是异步的,但是如果出现了一些设备不能连接,你可以配置一台主数据停止接收写入。
#(2)如果复制数据出现短暂性的连接失效, redis设备必须执行部分再同步主设备的数据。如果你需要正确的值继续传递。,你可以配置复制日志的大小(请查阅下此文件的部分)具有合理的值,根据你的需要。
#(3)复制是自动并且不需要人工干预,之后网络自动分开设备让重新连接主设备并且再次同步这些。
#slaveof <主设备IP> <主设备端口>

# If the master is password protected (using the "requirepass" configuration
# directive below) it is possible to tell the slave to authenticate before
# starting the replication synchronization process, otherwise the master will
# refuse the slave request.
#
# masterauth <master-password>

#如果这个主设备的密码是受保护的(使用“命令通行证”配置指导下),在启动同步复制的过程之前进行身份验证,否则主设备拒绝这个设备的请求。

# When a slave loses its connection with the master, or when the replication
# is still in progress, the slave can act in two different ways:
#
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
# still reply to client requests, possibly with out of date data, or the
# data set may just be empty if this is the first synchronization.
#
# 2) if slave-serve-stale-data is set to 'no' the slave will reply with
# an error "SYNC with master in progress" to all the kind of commands
# but to INFO and SLAVEOF.
#
slave-serve-stale-data yes
#当某个设备和主设备断开连接,或者当复制正在进行的时候,这个设备有两个不同的方式起作用。
#(1)如果设备不是最新的数据设置为"yes"(默认),那么这个设备将会回应客户端的请求,如果这个是第一次同步或许这个数据保存的仅仅是一个空白的
#(2)如果设备不是最新的数据且设置为"no",这个设备“同步主设备数据”所有的命令都会回应一个错误消息和变化。

# You can configure a slave instance to accept writes or not. Writing against
# a slave instance may be useful to store some ephemeral data (because data
# written on a slave will be easily deleted after resync with the master) but
# may also cause problems if clients are writing to it because of a
# misconfiguration.
#
# Since Redis 2.6 by default slaves are read-only.
#
# Note: read only slaves are not designed to be exposed to untrusted clients
# on the internet. It's just a protection layer against misuse of the instance.
# Still a read only slave exports by default all the administrative commands
# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
# security of read only slaves using 'rename-command' to shadow all the
# administrative / dangerous commands.
slave-read-only yes
#你可以配置实例是否接收写入,写入对实例来说可能是保存一些临时数据(因为数据太早写入同步主设备,很容易被删除)是有用的,
#如果客户端因为这个设置错误写入也许造成程序出现问题。

#redis 2.6之前的版本默认是只读的。
#注意:设备只读没有被设计来暴露在不受信任的客户在互联网上。
#这只是对实例的误操作的保护层。
#还有只读设备输出默认的所有管理命令的配置,调试,等等。
#在限制范围内,你可以使用“重命名命令”的背景来管理/安全的命令,来提高安全性。

# Replication SYNC strategy: disk or socket.
#
# -------------------------------------------------------
# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
# -------------------------------------------------------
#
# New slaves and reconnecting slaves that are not able to continue the replication
# process just receiving differences, need to do what is called a "full
# synchronization". An RDB file is transmitted from the master to the slaves.
# The transmission can happen in two different ways:
#
# 1) Disk-backed: The Redis master creates a new process that writes the RDB
# file on disk. Later the file is transferred by the parent
# process to the slaves incrementally.
# 2) Diskless: The Redis master creates a new process that directly writes the
# RDB file to slave sockets, without touching the disk at all.
#
# With disk-backed replication, while the RDB file is generated, more slaves
# can be queued and served with the RDB file as soon as the current child producing
# the RDB file finishes its work. With diskless replication instead once
# the transfer starts, new slaves arriving will be queued and a new transfer
# will start when the current one terminates.
#
# When diskless replication is used, the master waits a configurable amount of
# time (in seconds) before starting the transfer in the hope that multiple slaves
# will arrive and the transfer can be parallelized.
#
# With slow disks and fast (large bandwidth) networks, diskless replication
# works better.
repl-diskless-sync no
#同步复制策略:磁盘或者接口
#警告:目前是无磁盘复制的实验。
#新的设备和重新连接的设备不能继续复制过程中接收的差异,需要这么做是所谓的“完全同步”。
#一个数据文件是从主站往从站发送,这个传送可以有两个不同的方式。
#(1)有磁盘:这个redis主设备创建一个进程写入一个数据库文件到磁盘上,接着这个文件从父程序被迁移其他设备上递增。
#(2)无磁盘:这个主设备创建一个新进程直接写入到数据库文件的设备接口,不能接触这个磁盘。
# 随着磁盘备份复制,生成数据库文件,一旦子进程完成产生数据库文件这个工作,更多的设备可以排队服务于数据库文件。
#如果不是一开始是无磁盘复制,新的设备抵达的队列和当前进程终止时,新的传输将开始。
#当无磁盘被复制的,主设备等待配置的数量的时间(秒)之前启动传输给多个设备数据。
#关于缓慢的磁盘和快速的磁盘(大的带宽)网络,无磁盘复制更多会更好。

# When diskless replication is enabled, it is possible to configure the delay
# the server waits in order to spawn the child that trnasfers the RDB via socket
# to the 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.
#
# 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.
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.
#
# repl-ping-slave-period 10

#当一个无磁盘复制开启,这个需要被设置为可配置的,延迟服务器等待,命令大量的子线程通过socket来输出数据到其他设备。
#自从传输开启这个变得很重要,这个不能服务与其他新设备的传送,让队列来负责新数据的传输,这样服务器等待延迟减少让更多的设备进行传送。
#延迟的时间被设置带规定的秒数内,默认是5秒。完全禁用它仅需要设置0秒就可以尽快启动并传递。
#服务发送预设定的间隔脉动信息给服务器,这个可能会改变当前间隔关于发送回显信息设备时期选项,这个默认的值是10秒。

# The following option sets the replication timeout for:
#
# 1) Bulk transfer I/O during SYNC, from the point of view of slave.
# 2) Master timeout from the point of view of slaves (data, pings).
# 3) Slave timeout from the point of view of masters (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-timeout 60

#下面选项设置复制的超时时间:
#(1)从设备上角度上面看,批量转移同步的时候压力在I/O上。
#(2)从其他设备角度看主设备超时(数据、脉动)
#(3)从主设备看从设备超时来(排斥确认脉动信息)

#这个很重要可以确保这个值是大于指定的替代的ping设备时间,否则为超时。在主设备跟其他设备上查明每个时间的较低的通行时间。

 

# Disable TCP_NODELAY on the slave socket after SYNC?
#
# 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.
#
# 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.
#
# 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.
repl-disable-tcp-nodelay no

#禁用TCP在设备socket同步之后不缓冲?
#如果查询是"yes",redis将会使用少量的TCP包和更少的带宽发送数据到从设备上,但是这样会增加延迟数据到设备上。
#40毫秒在linux内核中使用默认的配置。
#如果查询"no",数据出现在设段的时间会减少。但是更多的带宽将用于复制。
#默认我们优化了低速的问题,但是非常长的传输环境或者主设备和其他设备有很多连接不成功,改变值为“yes”是好的选择。

# Set the replication backlog size. The backlog is a buffer that accumulates
# slave data when slaves are disconnected for some time, so that when a slave
# wants to reconnect again, often a full resync is not needed, but a partial
# resync is enough, just passing the portion of data the slave missed while
# disconnected.
#
# The bigger the replication backlog, the longer the time the slave can be
# disconnected and later be able to perform a partial resynchronization.
#
# The backlog is only allocated once there is at least a slave connected.
#
# repl-backlog-size 1mb

#设置复制备份日志的大小,当设备断开连接一段时间,这个备份日志在缓冲堆积在设备上的数据,
#当一个设备想要重新连接,经常全部同步不是最好的选择,部分同步就足够了,断开连接仅仅通过的一部分数据在设备上发生错误。
#复制积压越大,时间越长,从机可以被断开,以后还可以进行部分重新同步的时间。
#积压只分配一次至少有一个设备连接。
#复制挤压大小


# After a master has no longer connected slaves for some time, the backlog
# will be freed. The following option configures the amount of seconds that
# need to elapse, starting from the time the last slave disconnected, for
# the backlog buffer to be freed.
#
# A value of 0 means to never release the backlog.
#
# repl-backlog-ttl 3600
#其他设备不会很长时间不连接主设备,这个挤压被释放,从最后设备断开时间开始,挤压的缓冲区将被释放。
#平均值为0不用释放挤压。

# The slave priority is an integer number published by Redis in the INFO output.
# It is used by Redis Sentinel in order to select a slave to promote into a
# master if the master is no longer working correctly.
#
# A slave with a low priority number is considered better for promotion, so
# for instance if there are three slaves with priority 10, 100, 25 Sentinel will
# pick the one with priority 10, that is the lowest.
#
# However a special priority of 0 marks the slave as not able to perform the
# role of master, so a slave with priority of 0 will never be selected by
# Redis Sentinel for promotion.
#
# By default the priority is 100.
slave-priority 100
#这个设备的优先是redis输出的整数信息。这个利用redis哨兵,如果主设备不在正常工作以便选择推动为主设备。
#低优先级的设备被认为是促进更好,比如一个这样的例子,如果三个设备的数字是10,100,25,传输优先选择其中一个数字10,这个是最低的。
#然而0特别优先权,标志着从站不能执行主站的作用,所以为0优先将永远不会被redis的哨兵晋升选择。
#默认的优先是100

# It is possible for a master to stop accepting writes if there are less than
# N slaves connected, having a lag less or equal than M seconds.
#
# The N slaves need to be in "online" state.
#
# The lag in seconds, that must be <= the specified value, is calculated from
# the last ping received from the slave, that is usually sent every second.
#
# This option does not GUARANTEE that N replicas will accept the write, but
# will limit the window of exposure for lost writes in case not enough slaves
# are available, to the specified number of seconds.
#
# For example to require at least 3 slaves with a lag <= 10 seconds use:
#
# min-slaves-to-write 3
# min-slaves-max-lag 10
#
# Setting one or the other to 0 disables the feature.
#
# By default min-slaves-to-write is set to 0 (feature disabled) and
# min-slaves-max-lag is set to 10.

#当主设备有可能停止接收写入如果连接数低于N的,滞后传输小于或等于M秒。
#N台设备必须在线状态。
#从设备在每秒滞后的时间,这个必须小于等于指定的值,是最后ping接收设备的时间,通常每秒发送。
#当前选项不能保证N个副本接收写入,但是限制暴露丢失的窗口的情况下没有足够的设备也可以写入,规定多少秒之后重传。
#比如最后三个设备第二次请求的使用数量<=10个
#最小的设备写入 30
#
#禁用该功能则设置一个或其他为0
#默认最小的写入设备的数量设置为0(功能禁用)和最小的设备的最大延迟数量为10

################################## SECURITY(安全) ###################################

# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
# requirepass foobared
#要求客户端处理任何的命令的问题之前发出认证<密码>,在这环境下,你不能信任能够访问主机运行redis服务器是有用的,

#这应该保持注释掉的向后兼容,因为大部分的人都不需要认证(例如,它们运行自己的服务器)
#警告:之前的redis对已经退出登录的用户要发送高达每秒150k的密码兑好框,这意味着你可以使用复杂的密码否则太简单的密码会被破解。

# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possible to completely kill a command by renaming it into
# an empty string:
#
# rename-command CONFIG ""
#
# Please note that changing the name of commands that are logged into the
# AOF file or transmitted to slaves may cause problems.

#重命名命令
#在公共环境改变名称是危险的命令,比如配置命令重命名困难的猜测,这样仍然是供内部使用的工具 你不能用于通常的客户端。
#例子:
#它也可以通过重命名成一个空字符串彻底杀灭的命令:。
#重命名命令配置

#请注意改变名称的命令被记录到AOF文件或发送到设备的名称可能引发问题。


################################### LIMITS ####################################

# Set the max number of connected clients at the same time. By default
# this limit is set to 10000 clients, however if the Redis server is not
# able to configure the process file limit to allow for the specified limit
# the max number of allowed clients is set to the current file limit
# minus 32 (as Redis reserves a few file descriptors for internal uses).
#
# Once the limit is reached Redis will close all the new connections sending
# an error 'max number of clients reached'.
#
# maxclients 10000
#设置最大连接客户端的设备数,默认的连接数为1000个,
#然而如果redis服务器没有配置处理文件的限制允许规定的最大允许的连接的客户端的限制来设置流行的文件限制减去32,
#(作为Redis的保留了一个一些文件描述符供内部使用)
#一旦达到极限的redis将关闭所有新连接发送错误“超过最大客户端连接数”


# The Linux version of Redis relies on the system call fork() to perform
# point-in-time snapshots of the heap. In addition to the AOF and RDB backup
# mechanism, the master-slave synchronization and clustering features are
# dependent on this behavior of fork(). In order for the Windows version to
# perform like the Linux version we had to simulate this aspect of fork().
# Doing so meant moving the Redis heap into a memory mapped file that can
# be shared with a child process.

#在linux版本中的redis依赖于系统呼叫叉在堆上运行是点实时快照,增加了AOF和RDB备份的机制,
#主设备同步和集群功能都依赖于当前行为的叉。为了windows允许的版本像linux版本一样,我们不得不模仿当前叉的方面。
#这意味着移动redis的堆的数据可以和一子线程共享的存储器映射文件。

#
# *** There must be disk space available for this file in order for Redis
# to launch. *** The default configuration places this file in the local
# appdata directory. If you wish to move this file to another local disk,
# use the heapdir flag as described below.
#必须为了让redis的推出适用于此文件的磁盘空间,**本地应用程序数据目录的缺省配置此文件。
#如果你希望移动这个文件到其他本地磁盘,使用堆的文件标志来阐述。
#
# The maxheap flag controls the maximum size of this memory mapped file,
# as well as the total usable space for the Redis heap. Running Redis
# without either maxheap or maxmemory will result in a memory mapped file
# being created that is equal to the size of physical memory. During
# fork() operations the total page file commit will max out at around:
#
# (size of physical memory) + (2 * size of maxheap)
#
# For instance, on a machine with 8GB of physical RAM, the max page file
# commit with the default maxheap size will be (8)+(2*8) GB , or 24GB. The
# default page file sizing of Windows will allow for this without having
# to reconfigure the system. Larger heap sizes are possible, but the maximum
# page file size will have to be increased accordingly.
#
# The Redis heap must be larger than the value specified by the maxmemory
# flag, as the heap allocator has its own memory requirements and
# fragmentation of the heap is inevitable. If only the maxmemory flag is
# specified, maxheap will be set at 1.5*maxmemory. If the maxheap flag is
# specified along with maxmemory, the maxheap flag will be automatically
# increased if it is smaller than 1.5*maxmemory.
#
# maxheap <bytes>
#最大堆的标志控制该存储容器映射文件的最大尺寸,以及用于redis堆的总的可用空间。
#运行的redis没有在最大的堆或最大内存会导致等于物理内存的大小要创建一个内存映射文件。
#在接口操作总的页数文件承诺将最大输出约为。
#(物理内存的大小)+(2*最大堆的大小)
#比如:一台机器有8G的物理内存,最大的页码文件提交默认的最大堆的大小(8)+(2*8)GB,或者24GB,
#在window上面默认的页码文件大小会考虑到这一点,无需重新配置当前系统,更大的堆的大小是很有可能的,
#但是最大页文件的大小必须也相应增加。

#redis堆必须比指定的最大内存值还要大,就像堆配置器有里面的内存请求和堆是不可避免。
#如果只指定最大内存标志,那么最大堆设定为1.5倍的最大内存,如果堆的标记是最大内存,
#如果最小的堆1.5倍内存小堆自动的增加。

# The heap memory mapped file must reside on a local path for heap sharing
# between processes to work. A UNC path will not suffice here. For maximum
# performance this should be located on the fastest local drive available.
# This value defaults to the local application data folder(e.g.,
# "%USERPROFILE%\AppData\Local"). Since this file can be very large, you
# may wish to place this on a drive other than the one the operating system
# is installed on.
#
# Note that you must specify a directory here, not a file name.
# heapdir <directory path(absolute or relative)>
#堆内存映射文件必须包含本地路径给工作堆,不知道的路径不能满足这个,
#为了获得最大性能本应位于最快的本地驱动器上。这个值默认在本地应用程序的数据文件夹中(例如/%用户描述%\应用程序数据\本地),
#由于此文件可能会非常大,你或许希望把这个驱动器安装在其他的操作系统上。

#注意你必须指定一个目录,不能没有文件。
#堆文件<目录路径(绝对或者相对)>

# If Redis is to be used as an in-memory-only cache without any kind of
# persistence, then the fork() mechanism used by the background AOF/RDB
# persistence is unneccessary. As an optimization, all persistence can be
# turned off in the Windows version of Redis. This will disable the creation of
# the memory mapped heap file, redirect heap allocations to the system heap
# allocator, and disable commands that would otherwise cause fork() operations:
# BGSAVE and BGREWRITEAOF. This flag may not be combined with any of the other
# flags that configure AOF and RDB operations.
# persistence-available [(yes)|no]
#如果redis使用内存高速缓存没有任何形式的持久化,且接口机制使用的是持久化的AOF/RDB是不必要的。
#作为一种优化方法,windows上面的redis版本的所有持久化是关闭,这个禁用创建内存堆的文件,
#重置系统堆中的配置器的配置,禁用命令否则会成为对叉的操作:
#子线程保存和子程序重写,此标志不得与任何的配置AOF和RDB操作的其他标志组合。
#持久化-可用

# Don't use more memory than the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys
# according to the eviction policy selected (see maxmemory-policy).
#
# If Redis can't remove keys according to the policy, or if the policy is
# set to 'noeviction', Redis will start to reply with errors to commands
# that would use more memory, like SET, LPUSH, and so on, and will continue
# to reply to read-only commands like GET.
#
# This option is usually useful when using Redis as an LRU cache, or to set
# a hard memory limit for an instance (using the 'noeviction' policy).
#
# WARNING: If you have slaves attached to an instance with maxmemory on,
# the size of the output buffers needed to feed the slaves are subtracted
# from the used memory count, so that network problems / resyncs will
# not trigger a loop where keys are evicted, and in turn the output
# buffer of slaves is full with DELs of keys evicted triggering the deletion
# of more keys, and so forth until the database is completely emptied.
#
# In short... if you have slaves attached it is suggested that you set a lower
# limit for maxmemory so that there is some free RAM on the system for slave
# output buffers (but this is not needed if the policy is 'noeviction').
#
# WARNING: not setting maxmemory will cause Redis to terminate with an
# out-of-memory exception if the maxheap limit is reached.
#
# maxmemory <bytes>

#不能使用太多内存比指定的字节数量还多。
#当内存提交到redis会尽量根据所选的驱逐策略(查看最大回收数),以排除这个key
#如果redis根据策略无法删除键,或者策略设置为noeviction(永久不过期),
#redis将会开启回复错误命令这样需要使用更多的内存,像存储,列表等等,
#这样将会延迟回复只读的命令,如get(获取)。
#这个选项通常在使用redis如一块内存块,或者存储硬内存限制的例子(使用noeviction(永久不过期)的策略)。

#警告:如果你有设备连接最大内存上,需要空余设备输出缓冲区的大小从使用内存数量减去一个实例设备。
#且网络问题/重新同步不会触发一个key进行驱逐出循环,反过来从站的输出缓冲区满的删除的key触发删除更多的keys,直至数据被完全清空。
#总之,如果你有设备附加,建议你为最大内存设置下限,
#以便有系统从输出缓冲器上的一些免费的RAM(但是如果策略是"noeviction"就不需要)
#警告:如果搭到最大堆限制,如果没有设置最大内存这样会导致redis与内存不足的异常终止。

# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
#
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key according to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
#
# Note: with any of the above policies, Redis will return an error on write
# operations, when there are no suitable keys for eviction.
#
# At the date of writing these commands are: set setnx setex append
# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
# getset mset msetnx exec sort
#
# The default is:
#
# maxmemory-policy volatile-lru

#最大内存策略:redis怎么会选择当达到最大内存删除什么,你可以在五个行为中选择。
#不稳定的内存块->删除与使用LRU算法到期设置key
#所有keys内存卡->根据LRU算法删除任何key
#不稳定的随机数->删除随机密钥具有到期设置
#所有的key的随机->删除随机密钥,任意键
#不稳定的最大网段数量)(Time To Live)->移除key关于最近过期的(较小的网段数量)
#永远过期(noeviction)->不会过期可言,只是返回的写操作错误

#注意:上诉任何政策,当没有适当的key被回收的时候,redis会在写操作返回一些错误。
#在编写这些命令的日期:设置分布式锁的拷贝(setnx setex)添加到redis,推动rpush lpush rpushx lpushx linsert lset rpoplpush sadd sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby getset mset msetnx exec sort
#默认的是:最大内存策略 不稳定的内存块。


# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample
# size to check. For instance for default Redis will check three keys and
# pick the one that was used less recently, you can change the sample size
# using the following configuration directive.
#
# maxmemory-samples 3
#LRU和最小的TTL算法是不够准确的算法,但是也接近了算法(为了节省内存),所以你可以选择和样本量进行检查,比如默认的redis验证三个key和选择较少的最近的一个,你可以使用下面的配置指令改变样本大小。
#最大内存模版数:3

############################## APPEND ONLY MODE(附加只读的方式) ###############################

# By default Redis asynchronously dumps the dataset on disk. This mode is
# good enough in many applications, but an issue with the Redis process or
# a power outage may result into a few minutes of writes lost (depending on
# the configured save points).
#
# The Append Only File is an alternative persistence mode that provides
# much better durability. For instance using the default data fsync policy
# (see later in the config file) Redis can lose just one second of writes in a
# dramatic event like a server power outage, or a single write if something
# wrong with the Redis process itself happens, but the operating system is
# still running correctly.
#
# AOF and RDB persistence can be enabled at the same time without problems.
# If the AOF is enabled on startup Redis will load the AOF, that is the file
# with the better durability guarantees.
#
# Please check http://redis.io/topics/persistence for more information.

appendonly no

#默认的redis异步转存数据集在硬盘上,这个模式在许多应用中不够好,但是一个问题是关于redis的过程或停电,可能会导致成写入几分钟丢失(取决于所配置的保存点)
#追加仅文件是另一种持久性模式,提供更好的耐用性。比如使用默认的数据完全同步策略(参见后面的配置文件) ,
#redis戏剧性的事件,例如服务器电源断电,或者简单的写入如果redis程序出现故障,但是丢失写入只需一秒操作系统仍然稳定运行。

#AOF和RDB持久化被启用可以在同一时间不能出问题,如果AOF开启redis启动就会加载AOF,这个文件可以更好耐用性担保文件。
#请验证 更多的信息、


# The name of the append only file (default: "appendonly.aof")
appendfilename "appendonly.aof"
#这个名称添加到文件中(默认: "")

# The fsync() call tells the Operating System to actually write data on disk
# instead of waiting for more data in the output buffer. Some OS will really flush
# data on disk, some other OS will just try to do it ASAP.
#
# Redis supports three different modes:
#
# no: don't fsync, just let the OS flush the data when it wants. Faster.
# always: fsync after every write to the append only log . Slow, Safest.
# everysec: fsync only one time every second. Compromise.
#
# The default is "everysec", as that's usually the right compromise between
# speed and data safety. It's up to you to understand if you can relax this to
# "no" that will let the operating system flush the output buffer when
# it wants, for better performances (but if you can live with the idea of
# some data loss consider the default persistence mode that's snapshotting),
# or on the contrary, use "always" that's very slow but a bit safer than
# everysec.
#
# More details please check the following article:
# http://antirez.com/post/redis-persistence-demystified.html
#
# If unsure, use "everysec".

# appendfsync always
appendfsync everysec
# appendfsync no

#让同步通知操作系统实际写入的数据在硬盘上,而不是在等待中的输出缓冲更多的数据,有些操作系统会在磁盘上真的刷新数据,一些其他的操作系统将只是尝试尽快做到这一点。
#Redis帮助 三个不同的方式:
#no:不同步,仅让操作系统更快的呈现数据,
#总是:同步之后每个谢日仅仅只是只读的日志,很慢,最安全。
#每秒写入:每秒同步,折中。
#默认是“每秒写入”,这个通常折中速度和数据安全。它是由你来了解,如果你可以轻松设置为"no",当想要数据的时候这个为让操作系统呈现输出的缓冲区,
#为了性能(如果你能忍受存在一些数据丢失的想法考虑默认的持久化模式快照)或相反,使用“总是”会执行速度非常慢但是比每秒写入多一点安全。
#更多描述请阅读下面文章:
#如果不明确,请使用”每秒写入“。
#总是添加同步
#每秒同步
#不同步
# When the AOF fsync policy is set to always or everysec, and a background
# saving process (a background save or AOF log background rewriting) is
# performing a lot of I/O against the disk, in some Linux configurations
# Redis may block too long on the fsync() call. Note that there is no fix for
# this currently, as even performing fsync in a different thread will block
# our synchronous write(2) call.
#当AOF同步策略设置为总是或者每秒写入,以及后台保存过程(一个后台进程进行写入AOF日志的操作)正在执行大量的对磁盘I / O写入,
#一些linux配置redis会阻止太长的同步调用,目前这个没有修好,因为即使执行FSYNC在不同的线程会阻塞我们的同步写的调用。
#
#
# In order to mitigate this problem it's possible to use the following option
# that will prevent fsync() from being called in the main process while a
# BGSAVE or BGREWRITEAOF is in progress.
#为了缓解这一问题有可能使用下列选项,将防止的fsync()被调用,主程序的全备份或者是全部的AOF写入。
#
# This means that while another child is saving, the durability of Redis is
# the same as "appendfsync none". In practical terms, this means that it is
# possible to lose up to 30 seconds of log in the worst scenario (with the
# default Linux settings).
#意味着其他进程来做保存操作,持久化的redis在 ”不同步“,在实际的项目中,这个意味着可能丢失30秒的日志,最坏的情况下(关于linux的配置)
#
# If you have latency problems turn this to "yes". Otherwise leave it as
# "no" that is the safest pick from the point of view of durability.
no-appendfsync-on-rewrite no
#如果您有延迟问题把这个为“yes”,否则如果是”no“,也就是最安全的挑但从耐久性的点。

# Automatic rewrite of the append only file.
# Redis is able to automatically rewrite the log file implicitly calling
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
#自动追加重写只读文件。
#调用全部写入当AOF日志的大小增加按照指定日志文件百分比,redis会自动化写入日志文件。
#
# This is how it works: Redis remembers the size of the AOF file after the
# latest rewrite (if no rewrite has happened since the restart, the size of
# the AOF at startup is used).
# 这个是怎样工作的:redis记住AOF文件大小之后重写写入(如果不重写已经重启,AOF在启动时的大小时)
#
# This base size is compared to the current size. If the current size is
# bigger than the specified percentage, the rewrite is triggered. Also
# you need to specify a minimal size for the AOF file to be rewritten, this
# is useful to avoid rewriting the AOF file even if the percentage increase
# is reached but it is still pretty small.
#这个基础大小对应当前的大小,如果当前大小是很大超过了规定的百分比,写入则会触发,
#接着你需要指定一个最小的AOF文件继续写入,这个有利于避开写入AOF文件,让规定增加达到的时候但是文件还是很小
#
# Specify a percentage of zero in order to disable the automatic AOF
# rewrite feature.
#指定一个百分为0会禁用自动写入AOF

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

# An AOF file may be found to be truncated at the end during the Redis
# startup process, when the AOF data gets loaded back into memory.
# This may happen when the system where Redis is running
# crashes, especially when an ext4 filesystem is mounted without the
# data=ordered option (however this can't happen when Redis itself
# crashes or aborts but the operating system still works correctly).
#在redis启动程序的时候一个AOF数据被加载到内存中可能会被截断,
#这个也许发生在redis运行系统崩溃的时候,尤其是当一个EXT4文件系统安装无数据=有序的选项
#(然而,当Redis的自身崩溃或中止,但操作系统仍正常工作这是不可能发生的)
#
# Redis can either exit with an error when this happens, or load as much
# data as possible (the default now) and start if the AOF file is found
# to be truncated at the end. The following option controls this behavior.
# 当redis发生错误的时候都会退出或者装载大量的数据(现在为默认)并且启动了,如果AOF文件会发现数据截断,下面的选项控制这种行为。
# If aof-load-truncated is set to yes, a truncated AOF file is loaded and
# the Redis server starts emitting a log to inform the user of the event.
# Otherwise if the option is set to no, the server aborts with an error
# and refuses to start. When the option is set to no, the user requires
# to fix the AOF file using the "redis-check-aof" utility before to restart
# the server.
#如果aof负载截断数据设置为yes,一个截断的AOF文件并且加载redis服务器开始发送出日志通知事件给用户。
#否则如果选择项设置为No,服务器将中止与错误并拒绝启动。
#用户需要修复使用的AOF文件“Redis的检查,AOF”实用程序之前重新启动服务器。
# Note that if the AOF file will be found to be corrupted in the middle
# the server will still exit with an error. This option only applies when
# Redis will try to read more data from the AOF file but not enough bytes
# will be found.
aof-load-truncated yes
#注意如果AOF文件会被发现中间的被破坏的服务器发生错误并退出,
#此选项只适用于当Redis的将尝试从AOF文件中读取更多的数据,
#但是没有足够的字节被发现。

################################ LUA SCRIPTING(脚本处理) ###############################

# Max execution time of a Lua script in milliseconds.
#
# If the maximum execution time is reached Redis will log that a script is
# still in execution after the maximum allowed time and will start to
# reply to queries with an error.
#
# When a long running script exceeds the maximum execution time only the
# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
# used to stop a script that did not yet called write commands. The second
# is the only way to shut down the server in the case a write command was
# already issued by the script but the user doesn't want to wait for the natural
# termination of the script.
#
# Set it to 0 or a negative value for unlimited execution without warnings.
lua-time-limit 5000
#以毫秒为单位的Lua脚本的最大执行时间。
#如果达到了最大执行时间的Redis将记录一个脚本仍处于最大允许时间之后执行并且将开始一个错误回答查询。
#当很长时间运行脚本超过最大执行时间只有脚本被停止并关闭不保存命令可用。
#第一可用于停止那些尚未称为写命令的脚本。
#第二次只有在服务器关机方式才能写入的命令已经发出的脚本但是用户不想等待自然结束这个脚本的服务器的唯一途径。
#设置0或者没有值会无限的执行没有警告。

################################ REDIS CLUSTER(redis集群) ###############################
#
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
# in order to mark it as "mature" we need to wait for a non trivial percentage
# of users to deploy it in production.
#实验警告:redis集群考虑稳定的代码,然而由于标志"成熟",
#我们需要等待用户的不平凡的百分比在生产中部署它。
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
# started as cluster nodes can. In order to start a Redis instance as a
# cluster node enable the cluster support uncommenting the following:
#
# cluster-enabled yes
#普通Redis的情况下,不能是Redis的集群的一部分;只有那些开始作为可以在群集节点的节点。
#为了启动一个Redis的实例作为群集节点启用集群支持取消注释以下内容:。


# Every cluster node has a cluster configuration file. This file is not
# intended to be edited by hand. It is created and updated by Redis nodes.
# Every Redis Cluster node requires a different cluster configuration file.
# Make sure that instances running in the same system do not have
# overlapping cluster configuration file names.
#
# cluster-config-file nodes-6379.conf
#每个集群的节点都有一个集群配置文件,这个文件不能故意被手动编辑过。这个创建跟更新redis的节点。
#每个redis集群节点需要不同的集群配置文件。确保在同一系统中运行的实例没有重叠群集配置文件名。

# Cluster node timeout is the amount of milliseconds a node must be unreachable
# for it to be considered in failure state.
# Most other internal time limits are multiple of the node timeout.
#
# cluster-node-timeout 15000
#集群节点超时时间为毫秒的节点必须是不可达使其在故障状态考虑的量。大多数其他内部时限多个节点超时

# A slave of a failing master will avoid to start a failover if its data
# looks too old.
#
# There is no simple way for a slave to actually have a exact measure of
# its "data age", so the following two checks are performed:
#
# 1) If there are multiple slaves able to failover, they exchange messages
# in order to try to give an advantage to the slave with the best
# replication offset (more data from the master processed).
# Slaves will try to get their rank by offset, and apply to the start
# of the failover a delay proportional to their rank.
#
# 2) Every single slave computes the time of the last interaction with
# its master. This can be the last ping or command received (if the master
# is still in the "connected" state), or the time that elapsed since the
# disconnection with the master (if the replication link is currently down).
# If the last interaction is too old, the slave will not try to failover
# at all.
#当一个设备是错误的主设备,如果这个数据太旧将避免启动故障转移。
#有一个设备,实际上有他的“数据长度”的具体措施,因此下面的两个进行检查,没有简单的方法:
#(1) 如果多个从设备能够进行故障转移,他们为了有利于从最好的复制偏移量(更多的数据来至主设备的传输)交换消息。
# 从设备将会尝试通过从他们的消息队列获取,应用启动故障转移延迟他们消息的传输速度。
#(2)每个从设备都有与主设备互动时间,这个可能是最后的ping或者是命令接收(如果主设备在仍是连接状态)
#或者与主设备断开经过的时间(如果当前的复制连接断开)。如果最后互动是很久之前,这个设备不会启动故障转移
#
# The point "2" can be tuned by user. Specifically a slave will not perform
# the failover if, since the last interaction with the master, the time
# elapsed is greater than:
#
# (node-timeout * slave-validity-factor) + repl-ping-slave-period
#如果要点“2”被用户调整,如果最后与主设备的互动的时间是很久之前,特别是一个设备不会执行故障转移。
#(节点超时*设备有效的系数)+复制-ping设备的时间
#
# So for example if node-timeout is 30 seconds, and the slave-validity-factor
# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
# slave will not try to failover if it was not able to talk with the master
# for longer than 310 seconds.
#比如如果节点超时30秒,设备的有效系数是10秒,假设默认的复制-ping设备的互动时间是10秒,
#如果设备连接主设备超时时间超过310秒这个设备不会故障转移。
#
#
# A large slave-validity-factor may allow slaves with too old data to failover
# a master, while a too small value may prevent the cluster from being able to
# elect a slave at all.
#大的有效系数可能是从设备与太旧的数据进行故障转移的主设备进行数据交互,很小的值避免集群推选出主设备。
#
# For maximum availability, it is possible to set the slave-validity-factor
# to a value of 0, which means, that slaves will always try to failover the
# master regardless of the last time they interacted with the master.
# (However they'll always try to apply a delay proportional to their
# offset rank).
#为了获取最大的可能性,这个可以设置设备有效系数为0,这个意味着从设备始终尝试他们最后一个与主设备互动,无论是够是故障转移的主设备。
#不过他们会一直努力的延迟比例应用来抵消他们的补偿等级。
#
# Zero is the only value able to guarantee that when all the partitions heal
# the cluster will always be able to continue.
#
# cluster-slave-validity-factor 10
#0是能够保证当所有分区的集群将始终能够继续工作下去。
#集群设备的有效系数


# Cluster slaves are able to migrate to orphaned masters, that are masters
# that are left without working slaves. This improves the cluster ability
# to resist to failures as otherwise an orphaned master can't be failed over
# in case of failure if it has no working slaves.
#集群设备转移成为孤立的主设备,这个主设备将不会继续工作,
#这个提高了设备抵制失败能力否则如果这个成为不能正常工作的设备,这个孤立的设备不能故障转移失败。
#
# Slaves migrate to orphaned masters only if there are still at least a
# given number of other working slaves for their old master. This number
# is the "migration barrier". A migration barrier of 1 means that a slave
# will migrate only if there is at least 1 other working slave for its master
# and so forth. It usually reflects the number of slaves you want for every
# master in your cluster.
#只要还有其他工作的从设备他们至少给定一个数字推荐让从设备转移为主设备,
#这个是“转移故障”,1意味着屏蔽迁移,如果存在至少一个其他从设备为主设备工作,从属仍仅迁移。
#
# Default is 1 (slaves migrate only if their masters remain with at least
# one slave). To disable migration just set it to a very large value.
# A value of 0 can be set but is useful only for debugging and dangerous
# in production.
#
# cluster-migration-barrier 1
#默认为1(如果他们主设备仍至少有一个从站,从设备仍要转移数据),停用转移仅仅需要设置一个很大的值。
#这个可以设置为0但是在调试和危险的生成中是有利的。
#集群转移故障
# By default Redis Cluster nodes stop accepting queries if they detect there
# is at least an hash slot uncovered (no available node is serving it).
# This way if the cluster is partially down (for example a range of hash slots
# are no longer covered) all the cluster becomes, eventually, unavailable.
# It automatically returns available as soon as all the slots are covered again.
# 默认情况下redis集群节点接收问题如果他们发现至少有一个哈希槽(没有可用的节点服务于这个)。
#这个方式如果集群数处于下降(比如一个访问的哈希槽不够长)例如一系列哈希插槽不再讨论)所有群集而成,最终无法使用。
#当槽聚集,马上自动的返回可用的。
#
# However sometimes you want the subset of the cluster which is working,
# to continue to accept queries for the part of the key space that is still
# covered. In order to do so, just set the cluster-require-full-coverage
# option to no.
#
# cluster-require-full-coverage yes

# In order to setup your cluster make sure to read the documentation
# available at http://redis.io web site.
#然而有时候你想要子集在集群中工作,持续接收查询功能一部分key空间仍要覆盖,一部分是这么做的,仅仅设置集群-要求-满的-范围选项。
#集群请求-最大的范围。
#为了设置你的集群让正确的可用到读取记录到 网站
################################## SLOW LOG*(槽日志) ###################################

# The Redis Slow Log is a system to log queries that exceeded a specified
# execution time. The execution time does not include the I/O operations
# like talking with the client, sending the reply and so forth,
# but just the time needed to actually execute the command (this is the only
# stage of command execution where the thread is blocked and can not serve
# other requests in the meantime).
#
# You can configure the slow log with two parameters: one tells Redis
# what is the execution time, in microseconds, to exceed in order for the
# command to get logged, and the other parameter is the length of the
# slow log. When a new command is logged the oldest one is removed from the
# queue of logged commands.

# The following time is expressed in microseconds, so 1000000 is equivalent
# to one second. Note that a negative number disables the slow log, while
# a value of zero forces the logging of every command.
slowlog-log-slower-than 10000

# There is no limit to this length. Just be aware that it will consume memory.
# You can reclaim memory used by the slow log with SLOWLOG RESET.
slowlog-max-len 128
#Redis的慢日志是一个系统来记录超出规定的执行时间的查询,执行时间不包含I/O操作像与客户端连接,
#发送回复等等操作,而只是实际执行命令所需要的时间(这个命令执行阶段在,其中线程堵塞,后台线程不能同时服务于其他多个请求)。

#这个你配置慢日志两个参数,一个告诉redis执行时间,微妙,以便超过为获得记录的命令,
#另外一个参数是慢日志的长度。当新的命令在被记录的时候,最早的日志会被从日志命令的消息队列从移除。

#这个通过的时间是毫秒,所以1000000相当于1秒,注意消极的数字相当于禁用槽日志,值为0强制记录每个命令
#槽日志最大值
#这个不能限制这个长度,这个需要消耗内存。
#这个开拓内存使用在槽的日志在槽日志重置。
################################ LATENCY MONITOR(延迟的监听) ##############################

# The Redis latency monitoring subsystem samples different operations
# at runtime in order to collect data related to possible sources of
# latency of a Redis instance.
#
# Via the LATENCY command this information is available to the user that can
# print graphs and obtain reports.
#
# The system only logs operations that were performed in a time equal or
# greater than the amount of milliseconds specified via the
# latency-monitor-threshold configuration directive. When its value is set
# to zero, the latency monitor is turned off.
#
# By default latency monitoring is disabled since it is mostly not needed
# if you don't have latency issues, and collecting data has a performance
# impact, that while very small, can be measured under big load. Latency
# monitoring can easily be enalbed at runtime using the command
# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
latency-monitor-threshold 0
#这个redis延迟监听子系统样本的不同操作的运行时间,为了尽可能的收集redis例子数据相关根源的反应时间。
#经过延迟的命令的信息对在打印图表和获取报告的用户是可用的。
#该系统只记录在一个时间等于或大于经延迟监视器阈值配置指令指定的毫秒的量所执行的操作,当这些值设置为0,这个延迟将会关闭
#如果你不会出现延迟的问题,默认的延迟监听可以禁用不需要这个,回收数据是一个影响性能的事,虽然这个对性能影响很小,这个取决于大负荷下测量
#如果需要延迟监听启动需要使用命令“配置设置延迟监听开关《毫秒》”。

############################# Event notification(事件通知) ##############################

# Redis can notify Pub/Sub clients about events happening in the key space.
# This feature is documented at http://redis.io/topics/notifications
#
# For instance if keyspace events notification is enabled, and a client
# performs a DEL operation on key "foo" stored in the Database 0, two
# messages will be published via Pub/Sub:
#
# PUBLISH __keyspace@0__:foo del
# PUBLISH __keyevent@0__:del foo

#redis通知发布/订阅 客户端关于事件发生的key的空间。
#这个功能处于记录在

#举个例子如果key空间事件通知被启用,并且在客户端上执行存储数据库为0密钥“浮”运行删除操作,两个消息将会发表通过:
#
#
# It is possible to select the events that Redis will notify among a set
# of classes. Every class is identified by a single character:
#
# K Keyspace events, published with __keyspace@<db>__ prefix.
# E Keyevent events, published with __keyevent@<db>__ prefix.
# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
# $ String commands
# l List commands
# s Set commands
# h Hash commands
# z Sorted set commands
# x Expired events (events generated every time a key expires)
# e Evicted events (events generated when a key is evicted for maxmemory)
# A Alias for g$lshzxe, so that the "AKE" string means all the events.
#
# The "notify-keyspace-events" takes as argument a string that is composed
# of zero or multiple characters. The empty string means that notifications
# are disabled.
#
# Example: to enable list and generic events, from the point of view of the
# event name, use:
#
# notify-keyspace-events Elg
#
# Example 2: to get the stream of the expired keys subscribing to channel
# name __keyevent@0__:expired use:
#
# notify-keyspace-events Ex
#
# By default all notifications are disabled because most users don't need
# this feature and the feature has some overhead. Note that if you don't
# specify at least one of K or E, no events will be delivered.
notify-keyspace-events ""
#这个可能是查询事件关于redis消息设置级别,每个级别认证是一个简单的字符。
#K 键空间事件,公布关于_键空间@ 前缀。
#E 关键事件,发布关于 @ 前缀。
#g 公共命令(无明确的类型)像 删除,过期,重命名。
#$ 字符串命令
#l 列表命令
#s 存储命令
#h 哈希命令
#z 分类存储命令
#x 过期事件(每时都有key过期的事件发生)
#e 逐离事件(当key达到最大的内存时事件逐离发生)
#A 别名如g$lshzxe,这个“密钥交换”意味着所有的事件。
# “通知key空间-事件”取得争论证一个字符串为空或者多个字符串,空的字符串意味着消息通知是禁用
#例子:启用list和泛型的事件,从所述事件名称的点,可以使用:
# 通知-键空间-事件
# 默认所有通知是禁用的,因为大多数使用不需要这个功能并且这个特征有一些开销,注意如果您不指定K或Ë中的至少一种,没有事件将交付

############################### ADVANCED CONFIG (高级配置)###############################

# Hashes are encoded using a memory efficient data structure when they have a
# small number of entries, and the biggest entry does not exceed a given
# threshold. These thresholds can be configured using the following directives.
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
#哈希利用存储器有效的数据结构进行编码时,他们有一个小数量的条目,而最大的条目不超过给定的阈值。这些阈值可以使用下面的指令来配置。
#哈希-最大-压缩列表-条目
#哈希-最大-压缩列表-值

# Similarly to hashes, small lists are also encoded in a special way in order
# to save a lot of space. The special representation is only used when
# you are under the following limits:
list-max-ziplist-entries 512
list-max-ziplist-value 64
#类似哈希,少数的列表是已编码的特殊方式,为了节省大量的空间,当你受到以下限制的特殊表示已用于:

# Sets have a special encoding in just one case: when a set is composed
# of just strings that happen to be integers in radix 10 in the range
# of 64 bit signed integers.
# The following configuration setting sets the limit in the size of the
# set in order to use this special memory saving encoding.
set-max-intset-entries 512
#保存一个特殊的编码案例::当一组由刚刚字符串恰好是在64位有符号整数的范围整数基数10。
# 下面的配置设置,才能使用这个特殊的节省内存的编码设置,在设置的大小限制。

# Similarly to hashes and lists, sorted sets are also specially encoded in
# order to save a lot of space. This encoding is only used when the length and
# elements of a sorted set are below the following limits:
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
#类似哈希和列表的,排序也有特殊的编码,从而节省大量的空间,这个编码仅仅用于当长度和排序集合的元素是以下限制。

# HyperLogLog sparse representation bytes limit. The limit includes the
# 16 bytes header. When an HyperLogLog using the sparse representation crosses
# this limit, it is converted into the dense representation.
#
# A value greater than 16000 is totally useless, since at that point the
# dense representation is more memory efficient.
#
# The suggested value is ~ 3000 in order to have the benefits of
# the space efficient encoding without slowing down too much PFADD,
# which is O(N) with the sparse encoding. The value can be raised to
# ~ 10000 when CPU is not a concern, but space is, and the data set is
# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
hll-sparse-max-bytes 3000
#HyperLogLog是稀疏表示字节的限制。这个限制包含16字节的报头,
#当一个HyperLogLog使用稀疏的表现超过这个限制,这个转换为密集的表现。
#一个值超过16000完全没用,因为在这一点上,茂密的表示是更多的内存效率。
#这个是建议的值是3000,以具有空间高效率编码的好处,不会减慢添加速度,这个将打开稀疏的编码,
#该值可提高到〜10000时CPU不是一个问题,但空间,并且数据集是由许多HyperLogLogs与基数在0 - 15000范围。

# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
# order to help rehashing the main Redis hash table (the one mapping top-level
# keys to values). The hash table implementation Redis uses (see dict.c)
# performs a lazy rehashing: the more operation you run into a hash table
# that is rehashing, the more rehashing "steps" are performed, so if the
# server is idle the rehashing is never complete and some more memory is used
# by the hash table.
#积极的重散列使用1毫秒,每100毫秒CPU的时间为了帮助主要的散列redis哈希表(一个映射顶层键的值),
#这个哈希表实现了redis使用(查看字典)执行懒散的散列:更多选项你运行一个哈希表是一个散列,
#更多散列步骤被执行,如果这个服务空闲,散列不会完成更多的内存被使用为哈希表。

# The default is to use this millisecond 10 times every second in order to
# actively rehash the main dictionaries, freeing memory when possible.
#
# If unsure:
# use "activerehashing no" if you have hard latency requirements and it is
# not a good thing in your environment that Redis can reply from time to time
# to queries with 2 milliseconds delay.
#
# use "activerehashing yes" if you don't have such hard requirements but
# want to free memory asap when possible.
activerehashing yes
#默认使用毫秒的每秒10次,积极处理从新处理主字典,释放内存在可能的情况。
#如果不确定:
#如果你的请求的数量少使用“活跃性不高”,这个在你的环境中不会是好的方法,Redis的可以从时间回复时间有2毫秒的延迟查询。
#使用“活跃性较高”,如果你没有这样的硬要求,但要释放内存在最短的时间可能。

# The client output buffer limits can be used to force disconnection of clients
# that are not reading data from the server fast enough for some reason (a
# common reason is that a Pub/Sub client can't consume messages as fast as the
# publisher can produce them).
#这个客户端输出缓冲区的限制,可用于压制那些从服务器读取数据的速度太快的客户端,一部分原因
#(客户端断开一个常见的原因是一个发布/订阅客户端无法使用消息以最快的速度发布者可以创建他们)
#
# The limit can be set differently for the three different classes of clients:
#这个限制设置了不同的。来至三个不同的类别的客户端:
#
# normal -> normal clients including MONITOR clients
# slave -> slave clients
# pubsub -> clients subscribed to at least one pubsub channel or pattern
#正常->正常的客户端包含监听的客户端
#设备->客户端设备
#发布订阅模型->客户端订阅了至少一个发布订阅信道或模式。
#
# The syntax of every client-output-buffer-limit directive is the following:
#每个客户端输出缓冲限制指令的语法如下:
#
# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
#客户端输出缓冲区的限制<分类>硬性限制><软限制><软秒>
#
# A client is immediately disconnected once the hard limit is reached, or if
# the soft limit is reached and remains reached for the specified number of
# seconds (continuously).
# So for instance if the hard limit is 32 megabytes and the soft limit is
# 16 megabytes / 10 seconds, the client will get disconnected immediately
# if the size of the output buffers reach 32 megabytes, but will also get
# disconnected if the client reaches 16 megabytes and continuously overcomes
# the limit for 10 seconds.
#客户端是立即断开一旦达到硬限制,或者在达到软限制和仍然达到了几秒钟(连续)指定的数量。
#比如如果硬性限制是32 兆字节,软限制是16 兆字节/10秒,如果输出的缓冲区的大小达到了32兆字节客户端将会立即断开
# 但是如果客户端达到了16兆字节且连续地克服了限制10秒钟将变成断开。
#
# By default normal clients are not limited because they don't receive data
# without asking (in a push way), but just after a request, so only
# asynchronous clients may create a scenario where data is requested faster
# than it can read.
#默认正常的客户端是没有限制的,因为他们接收数据不会要求(一种推送的方式),但是仅仅在一个请求之后,只有异步的可断创建一个脚本当数据被快速请求他才会读取。
#
# Instead there is a default limit for pubsub and slave clients, since
# subscribers and slaves receive data in a push fashion.
#取而代之的是一个默认发布订阅模型和客户端设备的限制,因为订阅器和设备接收数据推送的方式,
#
# Both the hard or the soft limit can be disabled by setting them to zero.
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
#无论是硬或软的限制可以通过他们的零设置来禁用。

# Redis calls an internal function to perform many background tasks, like
# closing connections of clients in timeot, purging expired keys that are
# never requested, and so forth.
#redis调用一个内部的方法来执行许多后台任务,像关闭客户端连接超时的,清除过期的键让其不能请求,等等
#
# Not all tasks are performed with the same frequency, but Redis checks for
# tasks to perform according to the specified "hz" value.
#不是所有的任务都具有相同的频率上进行,但Redis的检查任务根据指定“Hz”的值执行。
#
# By default "hz" is set to 10. Raising the value will use more CPU when
# Redis is idle, but at the same time will make Redis more responsive when
# there are many keys expiring at the same time, and timeouts may be
# handled with more precision.
#默认"hz"的设置为10,当redis空闲的时候增加一个值将使用更多的CPU,但是当很多键在同一时间过期让redis反应更灵敏,超时设置也许被操作需要更精确。
#
# The range is between 1 and 500, however a value over 100 is usually not
# a good idea. Most users should use the default of 10 and raise this up to
# 100 only in environments where very low latency is required.
hz 10
#值在1到500之间,然而一个值超过100不是一个好的建议,大多数用户应该使用默认值为10,只有在非常低的延迟是必需的环境下提出这个高达100。

# When a child rewrites the AOF file, if the following option is enabled
# the file will be fsync-ed every 32 MB of data generated. This is useful
# in order to commit the file to the disk more incrementally and avoid
# big latency spikes.
aof-rewrite-incremental-fsync yes
#当子节点被重写到AOF文件,如果在下面选项开启文件让内存数据写回磁盘的速度是32MB生成一次数据,这是为了更增量提交文件到盘和避免大的延迟高峰有用。

################################## INCLUDES(包含) ###################################

# Include one or more other config files here. This is useful if you
# have a standard template that goes to all Redis server but also need
# to customize a few per-server settings. Include files can include
# other files, so use this wisely.
#
# include /path/to/local.conf
# include /path/to/other.conf
#包含一个或者多个其他的配置文件,如果你有一个标准的模版让所有的redis服务器使用,这个需要定制一些每个服务器配置,是有利的。
#包含文件可以包含其他的文件,这么使用是很明智的。

posted @ 2015-10-20 09:30  ☆♂安♀★  阅读(495)  评论(0编辑  收藏  举报