📅  最后修改于: 2020-11-22 09:11:41             🧑  作者: Mango
“ ALTER keyspace”命令用于更改Cassandra中创建的键空间中的复制因子,策略名称和持久写入属性。
句法:
ALTER KEYSPACE WITH
要么
ALTER KEYSPACE "KeySpace Name"
WITH replication = {'class': 'Strategy name', 'replication_factor' : 'No.Of replicas'};
要么
Alter Keyspace KeyspaceName with replication={'class':'StrategyName',
'replication_factor': no of replications on different nodes}
with DURABLE_WRITES=true/false
例:
让我们以一个示例来演示“ Alter Keyspace”。这会将密钥空间策略从“ SimpleStrategy”更改为“ NetworkTopologyStrategy”,并且DataCenter1的复制因子从3更改为1。
ALTER KEYSPACE javatpoint
WITH replication = {'class':'NetworkTopologyStrategy', 'replication_factor' : 1};