首页 > 解决方案 > Redis 6 中主副本同步需要哪些 ACL 命令?

问题描述

在集群环境中使用 ACL 配置 Redis 6 时,必须创建一个额外的用户(假设不需要默认用户或无权访问 PSYNC 命令)。必须分配给该用户的确切命令是什么?

文档中有一个关于Sentinel 和副本的 ACL 规则 的小说明,表明 Sentinel 需要:

AUTH、客户端、订阅、脚本、发布、PING、INFO、MULTI、SLAVEOF、配置、客户端、执行

和副本需要:

PSYNC、REPLCONF、PING

我最好的猜测是将两者结合为一个命令集:

AUTH、客户端、订阅、脚本、发布、PING、INFO、MULTI、SLAVEOF、配置、客户端、执行、PSYNC、REPLCONF

摘自 redis.conf 表明“和/或复制所需的其他命令”

# If the master is password protected (using the "requirepass" configuration
# directive below) it is possible to tell the replica to authenticate before
# starting the replication synchronization process, otherwise the master will
# refuse the replica request.
#
masterauth mymasterpassword
#
# However this is not enough if you are using Redis ACLs (for Redis version
# 6 or greater), and the default user is not capable of running the PSYNC
# command and/or other commands needed for replication. In this case it's
# better to configure a special user to use with replication, and specify the
# masteruser configuration as such:
#
masteruser mymasteruser
#
# When masteruser is specified, the replica will authenticate against its
# master using the new AUTH form: AUTH <username> <password>.

标签: redisacl

解决方案


推荐阅读