Orientdb-alter-cluster

提供:Dev Guides
移動先:案内検索

OrientDB-クラスターの変更

*Alter Cluster* コマンドは、既存のクラスターの属性を更新します。 この章では、クラスターの属性を追加または変更する方法を学習できます。

次のステートメントは、クラスター変更コマンドの基本構文です。

ALTER CLUSTER <cluster> <attribute-name> <attribute-value>

上記の構文のオプションに関する詳細を次に示します。

*<cluster>* -クラスター名を定義します。
*<属性名>* -変更する属性を定義します。
*<attribute-value>* -この属性に設定する値を定義します。

次の表形式は、クラスター変更コマンドとともに使用できるサポートされている属性のリストを提供します。

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

バージョンが異なる場合に例外をスローします。 これがデフォルト設定です。

2

Content

バージョンが異なる場合は、コンテンツの変更をチェックします。そうでない場合は、例外をスローしないように最新バージョンを使用します。

3

Automerge

変更をマージします。

次のクエリ例を試して、クラスターの変更コマンドを学習します。

次のコマンドを実行して、クラスターの名前を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