Redis的配置文件redis.window.conf的详解

一、序言

    本节主要是讲解redis的配置文件,记得之前redis的配置文件是redis.conf现在版本的是redis.window.conf,当然我说的只是window版本的,至于linux版本的redis配置文件,暂时先不做介绍,等下一篇文章再进行讲解,以及两个的配置文件的区别,我的版本是3.0.504

二、详解配置文件

 1-13行

# Redis configuration file example

# 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 => 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.


翻译:

# redis 配置文件示例
 
# 当你需要为某个配置项指定内存大小的时候,必须要带上单位,
# 通常的格式就是 1k 5gb 4m 等格式:
#
# 1k  => 1000 bytes
# 1kb => 1024 bytes
# 1m  => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g  => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# 单位是不区分大小写的,你写 1K 5GB 4M 也行

   这几行不是太重要,相信大家看翻译也能看懂,在这里就不做讲解了

 15-31行

################################## 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.
#
# 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.
#
# 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


翻译

# 假如说你有一个可用于所有的 redis server 的标准配置模板,
# 但针对某些 server 又需要一些个性化的设置,
# 你可以使用 include 来包含一些其他的配置文件,这对你来说是非常有用的。
#
# 但是要注意哦,include 是不能被 config rewrite 命令改写的
# 由于 redis 总是以最后的加工线作为一个配置指令值,所以你最好是把 include 放在这个文件的最前面,
# 以避免在运行时覆盖配置的改变,相反,你就把它放在后面。
#
# include .\path\to\local.conf
# include c:\path\to\other.conf

  33-41行

################################ 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. 

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379

翻译

################################ 常用 #####################################
 
# 在windows中,默认情况下 redis 不是作为守护进程运行的,如果你想让它在后台运行,需要指定一个logfile。这个logfile会包含一个 pid

#监听端口号,默认为 6379,如果你设为 0 ,redis 将不在 socket 上监听任何客户端连接。

主要说了两部分,一个是守护线程,另外一个就是端口号

  所谓的守护线程就是指在程序中运行的时候在后台提供一种通用服务的线程,比如垃圾回收线程就是一个很称职的守护者,并且这种线程并不属于程序中不可缺少的一部分,因此,当所有的非守护线程结束时,程序就停止了,同时也会杀死进程中的守护线程,反过来说就是只要任何非守护线程

猜你喜欢

转载自blog.csdn.net/JavaWeb_Hao/article/details/82078340
今日推荐