Node.js connection redis cluster problem

NODE.JS cannot write to redis cluster

RT, attempts to write to the redis cluster, using alibaba"s ioredis. There was no problem writing redis with node_redis before. But after rewriting the cluster, it was found that it could not be written at all. And I don"t report it wrong. That is, cluster.set,get doesn"t seem to be implemented at all.

related codes

let redisIO = require("ioredis");

let cluster = new redisIO.Cluster([{
  port: 4379,
  host: "127.0.0.1"
}, {
  port: 4380,
  host: "127.0.0.1"
}]);

 cluster.set( "key" , "value").then(function (result) {
        console.log("function done");
      
          res.json({
            status: "0",
            msg: "",
          });
    
        }
      );

what result do you expect? What is the error message actually seen?

With the

code above, there is actually no set entering the redis cluster at all.

Menu