Redis5.0.3配置文件详解(易读白话翻译)安全与客户端

编程

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

# 为了让不信任的客户端访问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).

# 如果客户端和Redis server运行在同一个机器,我们也可以将"requirepass"注释掉,客户端就不需要校验密码。

# 可以推广到:如果在一个局域网里面,如果安全做得足够好,则都可以不设置"requirepass"

#

# 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 span password otherwise it will be very easy to break.

# 因为Redis可以每秒可以验证150K个密码,因此如果要设置密码,一定要设置一个非常强壮的密码,否则很容易被破解

#

# requirepass foobared

# Command renaming.

# 重命名command,可以保护我们的管理员命令和一些会导致Redis卡顿的命令

#

# 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 replicas may cause problems.

# 因为主节点的会将write命令使用缓冲区记录下来并传播给从节点执行,因此如果重命名的命令在从节点没有同步修改的话,这可能带来一些意想不到的问题,因此一定要小心这一点。

# 比如将set命令重命名为myset,那么在主节点执行myset foo Messi之后,从节点并不会有foo这个key,因为从节点并不认识myset这个命令

################################### CLIENTS ####################################

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

# 设置同时可以连接到服务器的客户端数量,默认值是10000,但如果主机的最大文件打开数并没有比"maxclients"大,那么"maxclients"=最大文件打开数-32,这个32是提供给Redis内部使用的,比如集群之间的通信等也需要连接数

#

# maxclients 10000

 

以上是 Redis5.0.3配置文件详解(易读白话翻译)安全与客户端 的全部内容, 来源链接: utcz.com/z/513256.html

回到顶部