我所有的 GET 命令都是从同一个节点调用的,该节点具有 1 个分片 3 个节点配置

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

All my GET commands are being called from the same node, which has 1 shard 3 node configuration. Of which 2 nodes are in one region and 3rd in another region.

使用与上面类似的 redis 集群连接

如何在redis集群中平均分配GET命令请求

我已经在 node.js 中编写了我的代码并使用 ioredis 包:

const Redis = require('ioredis');

const clusterNodes = [
  {
    host: 'node1.redis.cluster.com',
    port: 6379
  },
  {
    host: 'node2.redis.cluster.com',
    port: 6379
  },
  {
    host: 'node3.redis.cluster.com',
    port: 6379
  }
];

const redis = new Redis.Cluster(clusterNodes);
node.js redis amazon-elasticache redis-cluster
© www.soinside.com 2019 - 2024. All rights reserved.