cassandra客户端hector使用TIPs
HFactory.getOrCreateCluster("MyCluster","host1:9160,host2:9160,host3:9160")
?
方法二、
?
HFactory.getOrCreateCluster("MyCluster","host0:9160")cluster.addHost(new CassandraHost("host1", 9160), true);cluster.addHost(new CassandraHost("host2", 9160), true);cluster.addHost(new CassandraHost("host3", 9160), true);
? ?注意:addHost()方法第二个参数为true才会真正生效
?
--end
?
?
?