假设有一个具有以下结构的表:
create table cities (
root text,
name text,
primary key(root,name)
) with clustering order by (name asc); -- for getting them sorted
insert into cities(root,name) values('.','Moscow');
insert into cities(root,name) values('.','Tokio');
insert into cities(root,name) values('.','London');
select * from cities where root='.'; -- get'em sorted asc
Run Code Online (Sandbox Code Playgroud)
当为键空间指定复制因子3并使用RandomPartitioner时,3个节点上每行将有3个副本:主节点确定用于存储行的散列和2个下一个散列.为什么要有热点?从所有副本读取不是负载平衡?
cassandra ×1