Cassandra教程

Cassandra 更改键空间

" ALTER键空间"命令用于更改Cassandra中创建的键空间中的复制因子,策略名称和持久写入属性。
语法:
ALTER KEYSPACE <identifier> WITH <properties> 
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 

更改Cassandra中的键空间时的要点

键空间名称: 不能在Cassandra中更改键空间名称。 策略名称: 可以通过使用新的策略名称来更改策略名称。 复制因子: 可以通过使用新的复制因子来更改复制因子。 DURABLE_WRITES: : DURABLE_WRITES值可以通过指定值true/false来更改。默认情况下,这是事实。如果设置为false,则不会将任何更新写入提交日志,反之亦然。
示例:
让我们以一个示例来演示" Alter Keyspace"。这会将密钥空间策略从" SimpleStrategy"更改为" NetworkTopologyStrategy",并且DataCenter1的复制因子从3更改为1、
ALTER KEYSPACE lidihuo
WITH replication = {'class':'NetworkTopologyStrategy', 'replication_factor' : 1}; 

昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4