📅  最后修改于: 2020-11-26 05:29:35             🧑  作者: Mango
Alter Cluster命令用于更新现有群集上的属性。在本章中,您可以学习如何添加或修改集群的属性。
以下语句是Alter Cluster命令的基本语法。
ALTER CLUSTER
以下是上述语法中有关选项的详细信息。
以下表格格式提供了可与Alter cluster命令一起使用的受支持属性的列表。
Name | Type | Description |
---|---|---|
NAME | String | Changes the cluster name. |
STATUS | String | Changes the cluster status. Allowed values are ONLINE and OFFLINE. By default, clusters are online. |
COMPRESSION | String | Defines the compression type to use. Allowed values are NOTHING, SNAPPY, GZIP, and any other compression types registered in the OCompressionFactory class. |
USE_WAL | Boolean | Defines whether it uses the Journal when OrientDB operates against the cluster |
RECORD_GROW_FACTO R | Integer | Defines the grow factor to save more space on record creation. You may find this useful when you update the record with additional information. |
RECORD_OVERFLOW_GR OW_FACTOR | Integer | Defines grow factor on updates. When it reaches the size limit, is uses this setting to get more space, (factor > 1). |
CONFLICTSTRATEGY | String | Defines the strategy it uses to handle conflicts in the event that OrientDB MVCC finds an update or a delete operation it executes against an old record. |
下表提供了冲突策略列表。
Sr.No. | Strategy & Description |
---|---|
1 |
Version Throws an exception when versions are different. This is the default setting. |
2 |
Content In the event that the versions are different, it checks for changes in the content, otherwise it uses the highest version to avoid throwing an exception. |
3 |
Automerge Merges the changes. |
尝试使用以下示例查询来学习Alter cluster命令。
执行以下命令,将群集名称从Employee更改为Employee2。
orientdb {db = demo}> ALTER CLUSTER Employee NAME Employee2
如果上面的命令成功执行,您将获得以下输出。
Cluster updated successfully
执行以下命令,以使用集群ID将集群名称从Employee2更改为Employee。
orientdb {db = demo}> ALTER CLUSTER 12 NAME Employee
如果上面的命令成功执行,您将获得以下输出。
Cluster updated successfully
执行以下命令,将群集冲突策略更改为自动合并。
orientdb {db = demo}> ALTER CLUSTER V CONFICTSTRATEGY automerge
如果上面的命令成功执行,您将获得以下输出。
Cluster updated successfully