Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes上的Redis主/从设置抛出错误:BRPOPLPUSH{ReplyError:MOVED 2651_Kubernetes_Redis_Bull.js - Fatal编程技术网

Kubernetes上的Redis主/从设置抛出错误:BRPOPLPUSH{ReplyError:MOVED 2651

Kubernetes上的Redis主/从设置抛出错误:BRPOPLPUSH{ReplyError:MOVED 2651,kubernetes,redis,bull.js,Kubernetes,Redis,Bull.js,我使用优秀的Redis作为Kubernetes上的作业队列 它被配置为群集: 当Kubernetes在部署时重新启动时,我遇到以下错误: BRPOPLPUSH { ReplyError: MOVED 2651 <IP_ADDRESS>:6379 at parseError (/usr/src/app/node_modules/ioredis/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/usr/src/

我使用优秀的Redis作为Kubernetes上的作业队列

它被配置为群集:

当Kubernetes在部署时重新启动时,我遇到以下错误:

BRPOPLPUSH { ReplyError: MOVED 2651 <IP_ADDRESS>:6379
at parseError (/usr/src/app/node_modules/ioredis/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/usr/src/app/node_modules/ioredis/node_modules/redis-parser/lib/parser.js:302:14)
command:
{ name: 'brpoplpush',
args:
[ '{slack}:slack notifications:wait',
'{slack}:slack notifications:active',
'5' ] } }
这是配置映射:

Name:         redis-cluster-config
Namespace:    default
Labels:       <none>
Annotations:  <none>

Data
====
update-node.sh:
----
#!/bin/sh
REDIS_NODES="/data/nodes.conf"
sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" ${REDIS_NODES}
exec "$@"

redis.conf:
----
cluster-enabled yes
cluster-require-full-coverage no
cluster-node-timeout 15000
cluster-config-file nodes.conf
cluster-migration-barrier 1
appendonly yes
# Other cluster members need to be able to connect
protected-mode no

Events:  <none>
Name:redis集群配置
名称空间:默认值
标签:
注释:
资料
====
update-node.sh:
----
#!/bin/sh
REDIS_NODES=“/data/NODES.conf”
sed-i-e“/我自己/s/[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/${POD\u IP}/“${REDIS\u NODES}”
执行官“$@”
redis.conf:
----
已启用群集是
群集需要完全覆盖没有
群集节点超时15000
集群配置文件nodes.conf
集群迁移障碍1
只有是
#其他集群成员需要能够连接
保护模式编号
活动:
是正确的

如果这没有帮助:

const Redis=require('ioredis');
...
const ioCluster=new Redis.Cluster([redisConfig.Redis]);
const slackQueue=新队列(“松弛通知”{
前缀:{slack},
createClient:()=>ioCluster
});
const emailQueue=新队列(“电子邮件通知”{
前缀:{email},
createClient:()=>ioCluster
});

我会选择不使用ioredis,或者尝试将redis引擎降级到4.x。

您是否使用helm chart来设置redis?不使用helm chart。@bob_cobb,我打赌这是ioredis的问题。因此值得尝试使用主从式设置。看看,它默认情况下会生成一个常规的redis客户端。如果您通过
createClien,我想您可以修复它t
选项,使ioredis群集对象改为连接。请参阅示例
import { emailQueue, slackQueue } from 'worker/worker';

const queueOptions = {
  attempts: 2,
  removeOnComplete: true,
  backoff: {
    type: 'exponential',
    delay: 60 * 1000
  }
};

emailQueue.add(
  {
    params: {
      from: email,
      fromname: name,
      text: body
    }
  },
  queueOptions
);
slackQueue.add(
  {
    channelId: SLACK_CHANNELS.FEEDBACK,
    attachments: [
      {
        text: req.body.body
      }
    ]
  },
  queueOptions
);
Name:         redis-cluster-config
Namespace:    default
Labels:       <none>
Annotations:  <none>

Data
====
update-node.sh:
----
#!/bin/sh
REDIS_NODES="/data/nodes.conf"
sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" ${REDIS_NODES}
exec "$@"

redis.conf:
----
cluster-enabled yes
cluster-require-full-coverage no
cluster-node-timeout 15000
cluster-config-file nodes.conf
cluster-migration-barrier 1
appendonly yes
# Other cluster members need to be able to connect
protected-mode no

Events:  <none>