dse advrepコマンドライン・ツール

DSE Advanced Replicationコマンドライン・ツールのオプションおよびコマンド引数。

コマンドライン・ツールは、DSE Advanced Replicationの構成および使用のためのコマンドおよびオプションを提供します。

前提条件 

dse advrepコマンドライン・ツールには以下が必要です。
  • Cassandra Pythonドライバー
  • クリック・パッケージ
Ubuntuの場合:
sudo apt-get install g++ python-dev -y
$ sudo pip install cassandra-driver
Red HatおよびCentOSの場合:
sudo yum install gcc-c++ -y
$ sudo yum install python-devel    # might not be needed
$ sudo pip install cassandra-driver

DSE Advanced Replicationコマンド 

以下のDSE Advanced Replicationコマンドを使用できます。

DSE Advanced Replicationコマンド・オプション 

構文
$ dse [-f config_file] [-u username -p password] [-a jmx_username -b jmx_password]  [command-options] edge|hub [command-arguments]
認証情報を複数の方法で提供できます。「認証情報」を参照してください。
dse advrepのコマンドライン・ヘルプを表示するには:
dse advrep --help
DSE Advanced Replicationコマンドdse advrepでは、エッジまたはハブに対して以下のコマンド・オプションおよびすべてのサブコマンドがサポートされています。
コマンド・オプション 説明
[-q] [--host text] [--port port] dse advrepの一般的な引数がすべてのサブコマンドに適用されます。
  • -qは必要な出力のみを印刷します。
  • --host IP_address。デフォルト値はlocalhostです。
  • --port portはDSE Advanced Replication接続のポートです。デフォルト値は9042です。
--help dse advrepコマンドの説明を標準出力に送信します。

エッジ・ツー・ハブ・レプリケーション・チャネル・コマンド 

構文
dse advrep edge channel command [command-arguments] 
dse advrep edge channelのコマンドライン・ヘルプを表示するには、以下のようにします。
dse advrep edge channel --help

以下のチャネル・コマンドおよびコマンド引数がサポートされています。

コマンド コマンド コマンド引数
channel create キースペースのレプリケーション・チャネルを作成します:

--keyspace edge_keyspace_name

--table edge_table_name

--hub-keyspace hub_keyspace_name

--hub-table hub_table_name

--enabledまたは--disabled テーブルが作成されたときにレプリケーションを有効または無効にします。

--priority channel_priority

--edge-id edge_unique_id

--edge-id-col-name edge_col_name

channel conf キースペースのレプリケーション・チャネルを更新します:

--keyspace keyspace_name

--table table_name

--hub-keyspace remote_hub_keyspace_name

--hub-table remote_hub_table

--priority repl_ch_priority

--edge-id edge_uniqueID

--edge-id-col-name col_name

--enabled

channel pause キースペースのレプリケーション・チャネルを一時停止します:

--keyspace keyspace_name

channel resume キースペースのレプリケーション・チャネルを再開します:

--keyspace keyspace_name

channel status レプリケーション・チャネルのステータスを確認します。
channel delete レプリケーション・チャネルを削除します。

エッジの構成およびレプリケーションのコマンド 

構文
dse advrep edge conf [command-arguments]
dse advrep edge confのコマンドライン・ヘルプを表示するには、以下のようにします。
dse advrep edge conf --help

DSE Advanced Replicationコマンドのdse advrep edge confコマンドでは、以下のオプション・コマンド引数がサポートされています。

コマンド コマンド・オプション コマンド引数
edge conf エッジがそのハブを参照するように構成します。edge confコマンドにはエッジ・ノードの再起動が必要です。以下のコマンド引数の詳細については、dse advrep edge conf構成キーの説明を参照してください。

--hub-ip-addresses hub_IPaddress

--hub-port non_default_port

--debug-output true|false

--driver-allow-remote-dcs-for-local-cl true|false

--driver-compression lz4_or_snappy_algorithm

--driver-connect-timeout ms_driver_waits_to_connect_server

--driver-connections num_connections_to_create

--driver-connections-max max_num_connections_to_create

--driver-consistency-level consistency

--driver-local-dc dc_name

--driver-pwd username

--driver-read-timeout ms_driver_waits_to_read_server_responses

--driver-used-hosts-per-remote-dc number_of_hosts

--driver-user password

--edge-id edge_unique_id

--edge-id-col-name edge_col_name

--edge-replication

--invalid-message-log logging_strategy

--invalid-message-max-retries max_retry_num

--replication-log-audit-log-enabled true|false

--replication-log-audit-log-file-gzipped true|false

--replication-log-audit-log-file prefix_template_name

--replication-log-audit-log-file-rotate-time-max-lifespan-mins mins

--replication-log-audit-log-file-rotate-time-mins mins

--replication-log-buckets num_random_buckets:num_time_buckets:time_unit:num_time_unit

--replication-max-permits max_permits_avail

--replication-min-permits min_permits_avail

--replication-permit-timeout-ms timeout_ms

--replication-permits-tuning-delta-percentage interval_ms

--replication-permits-tuning-window-ms interval_ms

--replication-timeouts-lower-bound-ratio percentage

--replication-timeouts-upper-bound-ratio percentage

--replog-consumer-buffer num_msgs_node_reads_from_repl_log

--slow-track-min-bandwidth-percentage percentage

--help

edge list-conf このエッジのすべての構成値をリストします。
edge start ハブへのエッジ・レプリケーションを開始します。
edge stop ハブへのエッジ・レプリケーションを停止します。
edge rl-count レプリケーション・ログに保持されているレコードの数を確認します。
  status ハブへのエッジ・レプリケーションのステータスを確認します。

メトリクス 

エッジまたはハブのノードのコマンドラインからメトリクスを表示します。JMXアクセスが必要です。
dse advrep edge metrics
dse advrep edge|hub metricsのコマンドライン・ヘルプを表示するには、以下のようにします。
dse advrep edge|hub metrics --help
コマンド コマンド・オプション
metrics [--no-pretty-print] データをコンマ区切りリストで出力します。デフォルト:tabular output。
  [--separator field_separator] テキスト。デフォルトのコンマ(,)セパレーター以外のセパレーターを指定するには、--no-pretty-printオプションのみを指定します。
  [--metric-type filter_by_type]
  [--metric-group filter_by_group]
  [--timeout seconds]接続を待機するタイムアウト(秒)。デフォルト: 5
  [--jmx-user JMX_username]
  [--jmx-pwd JMX_password]
  [--help]

レプリケーション・コマンドの例 

dse advrep edge replication channelコマンドライン・ツールの例および結果を以下に示します。
エッジ・レプリケーション・チャネルを作成する 
dse advrep edge channel create --keyspace foo --table bar --hub-keyspace foo --hub-table bar --priority 1 --edge-id edge1 --edge-id-col-name edge_id --enabled
Created Replication Channel foo:bar

$ dse advrep edge channel status
keyspace_name | table_name | edge_id | edge_id_col_name | enabled | hub_keyspace_name | hub_table_name | ...
---------------------------------------------------------------------------------------------------------...
foo           | bar        | edge1   | edge_id          | True    | foo               | bar            | ...
エッジ・レプリケーション・チャネルを構成する 
dse advrep edge conf --edge-id "edge1" --edge-id-col-name "edge_id" --hub-ip-addresses "10.200.177.184"
Set replication config edge_id_col_name from None to edge_id
Set replication config hub_ip_addresses from None to 10.200.177.184
Set replication config edge_id from None to edge1
エッジ・レプリケーション・チャネルの構成を表示する 
dse advrep edge list-conf
field            | value
--------------------------------
edge_id          | edge1
hub_ip_addresses | 10.200.181.55
edge_id_col_name | edge_id
エッジ・レプリケーション・チャネルの構成を削除する 
dse advrep edge remove-conf config_to_remove
削除する1つ以上のチャネル構成プロパティを指定します。
たとえば、ドライバー構成を削除する場合は、以下のようにします。
dse advrep edge remove-conf --driver_user
Removed replication config driver_user value was my_hub_user
エッジからハブへのレプリケーションを開始し、ステータスを確認する 
dse advrep edge start
edge replication started
$ dse advrep edge status
edge replication is running
エッジからハブへのレプリケーションを停止する 
レプリケーションはエッジ・クラスター全体について停止します。エッジ上のノードのIPアドレスを指定します。
dse advrep -q --host 192.168.3.10 edge stop
edge replication stopped
レプリケーション・ログに保持されているレコード・カウントを確認する 
dse advrep edge rl-count

メトリクス・コマンドの例 

dse advrep edge metricsコマンドライン・ツールの例および結果を以下に示します。
すべてのメトリクスを表示する
dse advrep --host localhost --port 7199 -q edge metrics
Group                  | Type             | Count
-------------------------------------------------
ReplicationLogConsumer | Errors           | 0
ReplicationChannel     | ReloadErrors     | 1
ReplicationChannel     | DeliveryErrors   | 0
ReplicationLog         | MessageAddErrors | 0
Group | Type | Count | RateUnit | MeanRate | FifteenMinuteRate | Count | OneMinuteRate | ...
グループでフィルターする
dse advrep --host localhost --port 7199 -q edge metrics --metric-group ReplicationChannel
グループおよびタイプでフィルターする
dse advrep --host localhost --port 7199 -q edge metrics --metric-group ReplicationChannel --metric-type ReloadErrors
Group                  | Type             | Count
-----------------------------------------
ReplicationChannel     | ReloadErrors     | 1