我已经为 cassandra 集群配置了 4 个节点和 2 个种子。当我运行 nodetool status 时,各个节点的所有权如下,
node1 (seed1) - 24.5%
node2 - 15.0%
node3(seed2) - 46.1%
node4 - 14.5%
应该拥有应该有相同的百分比。如果是这样,我怎样才能使它相等。当我关闭node2和node4时,我可以插入/检索复制因子为2的数据。但是当我制作node1或node2时,我不能。得到以下异常,
SEVERE: me.prettyprint.hector.api.exceptions.HUnavailableException: : May not be enough replicas present to handle consistency level.
java.lang.Exception: me.prettyprint.hector.api.exceptions.HUnavailableException: : May not be enough replicas present to handle consistency level.
at com.july.storage.cassandra.util.CassandraDBUtil.getData(CassandraDBUtil.java:197)
at com.july.storage.cassandra.util.CassandraDBUtil.doSelect(CassandraDBUtil.java:370)
at com.july.storage.cassandra.action.CassandraHandler.getCall(CassandraHandler.java:127)
at com.july.storage.service.StorageService.GET(StorageService.java:58)
at com.july.storage.cassandra.action.CassandraHandler.main(CassandraHandler.java:571)
Caused by: me.prettyprint.hector.api.exceptions.HUnavailableException: : May not be enough replicas present to handle consistency level.
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:59)
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:130)
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:100)
at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:103)
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258)
at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation(ExecutingKeyspace.java:97)
at me.prettyprint.cassandra.model.CqlQuery.execute(CqlQuery.java:99)
at com.july.storage.cassandra.util.CassandraDBUtil.getData(CassandraDBUtil.java:179)
谢谢, 桑吉塔