redis6.2.6版本配置详解

本文详细介绍了 Redis 6.2.6 版本的配置选项,包括内存管理、持久化、网络设置、安全性等多个方面,旨在帮助用户更好地理解和优化 Redis 的部署和使用。
摘要由CSDN通过智能技术生成
#redis 配置

################################## 配置 include ###################################


# 加载配置文件
# include /path/to/local.conf
# include /path/to/other.conf

################################## 模块 #####################################


# 加载模块
# loadmodule /path/to/my_module.so
# loadmodule /path/to/other_module.so

################################## 网络 #####################################

#指定 redis 只接收来自于该IP地址的请求,如果不进行设置,那么将处理所有请求
#bind 127.0.0.1 -::1

#是否开启保护模式,默认开启。要是配置里没有指定bind和密码。开启该参数后,redis只会本地进行访问,
#拒绝外部访问。要是开启了密码和bind,可以开启。否则最好关闭,设置为no
protected-mode no

#tcp keepalive参数。如果设置不为0,就使用配置tcp的SO_KEEPALIVE值,
#使用keepalive有两个好处:检测挂掉的对端。降低中间设备出问题而导致网络看似连接却已经与对端端口的问题。
#在Linux内核中,设置了keepalive,redis会定时给对端发送ack。检测到对端关闭需要两倍的设置值
tcp-keepalive 300

################################# TLS/SSL #####################################

# 默认情况下,禁用TLS / SSL。要启用它,请使用“ tls-port”配置。
# tls-port 6379

# tls-cert-file redis.crt 
# tls-key-file redis.key

# tls-key-file-pass secret


# tls-client-cert-file client.crt
# tls-client-key-file client.key

# tls-client-key-file-pass secret

# tls-dh-params-file redis.dh

# tls-ca-cert-file ca.crt
# tls-ca-cert-dir /etc/ssl/certs

# tls-auth-clients no
# tls-auth-clients optional

# tls-replication yes

# tls-cluster yes

# tls-ciphers DEFAULT:!MEDIUM

# tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256

# tls-prefer-server-ciphers yes

# tls-session-caching no

# tls-session-cache-size 5000

# tls-session-cache-timeout 60


################################# 通用 #####################################


# 是否后台启动(静默)
daemonize yes

# 可以通过upstart和systemd管理Redis守护进程,这个参数是和具体的操作系统相关的
# supervised auto

# redis的进程文件 
pidfile /var/run/redis_6379.pid

#指定了服务端日志的级别。级别包括:debug(很多信息,方便开发、测试),verbose(许多有用的信息)
#notice(适当的日志级别,适合生产环境),warn(只有非常重要的信息)
loglevel notice

 
#指定了记录日志的文件。空字符串的话,日志会打印到标准输出设备。后台运行的redis标准输出是/dev/null
logfile ""


#是否打开记录syslog功能
# syslog-enabled no


#syslog的标识符
# syslog-ident redis


#日志的来源、设备.
# syslog-facility local0


#数据库的数量,默认使用的数据库是0。可以通过”SELECT 【数据库序号】“命令选择一个数据库,序号从0开始
databases 16

# 是否显示redis logo
always-show-logo no

# By default, Redis modifies the process title (as seen in 'top' and 'ps') to
# provide some runtime information. It is possible to disable this and leave
# the process name as executed by setting the following to no.
set-proc-title yes

# When changing the process title, Redis uses the following template to construct
# the modified title.
#
# Template variables are specified in curly brackets. The following variables are
# supported:
#
# {title}           Name of process as executed if parent, or type of child process.
# {listen-addr}     Bind address or '*' followed by TCP or TLS port listening on, or
#                   Unix socket if only that's available.
# {server-mode}     Special mode, i.e. "[sentinel]" or "[cluster]".
# {port}            TCP port listening on, or 0.
# {tls-port}        TLS port listening on, or 0.
# {unixsocket}      Unix domain socket listening on, or "".
# {config-file}     Name of configuration file used.
#
proc-title-template "{title} {listen-addr} {server-mode}"

################################ rdb快照持久化  ################################

# rdb 持久化触发   每seconds(秒)有changes(个)键改变 在触发一次rdb持久化
# save <seconds> <changes>

#
# save 3600 1
# save 300 100
# save 60 10000
  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值