多个redis实例:打开Master所需的临时文件<->副本同步:权限被拒绝

问题描述 投票:0回答:1

我想在一台centOS 7服务器上运行多个redis实例。这些实例是只读副本,从另一台服务器同步。我按照这个问题的答案来运行第二个实例。

起初,我遇到了第二个实例使用的端口 6380 上没有权限的问题,但用

semanage port -a -t redis_port_t -p tcp 6380
修复了该问题。

实例正在启动,我可以访问它,但数据库是空的。复制应该发生,因为它完全取决于 redis 的配置文件。我通过

systemctl status redis2 -l

得到以下日志
Apr 11 14:41:31 example redis[15831]: Master replied to PING, replication can continue...
Apr 11 14:41:31 example redis[15831]: Partial resynchronization not possible (no cached master)
Apr 11 14:41:31 example redis[15831]: Full resync from master: c7a4e046a533d04f71ac7c78ae2f16dac2126a85:7312794
Apr 11 14:41:36 example redis[15831]: Opening the temp file needed for MASTER <-> REPLICA synchronization: Permission denied
Apr 11 14:41:37 example redis[15831]: Connecting to MASTER xx.xxx.xx.xx:6379
Apr 11 14:41:37 example redis[15831]: MASTER <-> REPLICA sync started
Apr 11 14:41:37 example redis[15831]: Non blocking connect for SYNC fired the event.
Apr 11 14:41:37 example redis[15831]: Master replied to PING, replication can continue...
Apr 11 14:41:37 example redis[15831]: Partial resynchronization not possible (no cached master)
Apr 11 14:41:37 example redis[15831]: Full resync from master: c7a4e046a533d04f71ac7c78ae2f16dac2126a85:7312794

我认为这里最重要的是

Apr 11 14:41:36 example redis[15831]: Opening the temp file needed for MASTER <-> REPLICA synchronization: Permission denied
暗示,我在某处缺少许可。我遵循的答案中涵盖的所有目录都经过三次检查,我在某处找不到错误的权限。

我在其他地方错过了什么吗?有人经历过这个问题并解决了吗?

redis centos7 redis-server
1个回答
0
投票

您解决过这个问题吗?具有相同行为的副本将给出以下错误:

Opening the temp file needed for MASTER <-> REPLICA synchronization: Permission denied

从 k9s 对副本 pod 进行 shell 操作还提供了一些有关用户权限的线索:

I have no name!@redis-replicas-1:/$ 

尝试在 /data 中创建任何文件时出现权限被拒绝错误

我正在使用部署到 kubernetes 的 bitnami-azure redis helm 图表。

© www.soinside.com 2019 - 2024. All rights reserved.