vertx-redis-client支持redis集群模式?

时间:2018-06-05 03:32:27

标签: redis vert.x

我看到vert-redis-client有很多redis集群api,但我编写代码,而不是得到结果 代码在这里

public class App {
public static void main(String[] args) {
    Vertx vertx = Vertx.vertx();
    RedisOptions redisOptions = new RedisOptions();
    redisOptions.setAddress("***********");
    redisOptions.setPort(6379);//this is redis cluster one of the nodes
    RedisClient redisClient = RedisClient.create(vertx, redisOptions);
    redisClient.clusterInfo(result -> {
        if (result.succeeded()) {
            JsonArray data = result.result();
            System.out.println(data.toString());
        } else {
            System.out.println("fail");
        }
    });

}

}

the output result is "fail", why?  Seeking guidance

0 个答案:

没有答案