10
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Riak doc の riak-admin Command Line を意訳してみた

Posted at

riak-admin Command Line

大雑把な意訳、訳しにくい箇所は英文のまま転載します
http://docs.basho.com/riak/1.3.2/references/Command-Line-Tools---riak-admin/

Overview

riak-admin は、Riak ノードに関係しないオペレーションを行ないます。ノードのメンバーシップや、バックアップ、基本的なステータスをレポートする機能を含んでいます。Riak ノードは、これらのコマンドの多くのために処理を行ないます。

Usage: riak-admin { cluster | join | leave | backup | restore | test |
                    reip | js-reload | erl-reload | wait-for-service |
                    ringready | transfers | force-remove | down |
                    cluster-info | member-status | ring-status | vnode-status |
                    diag | status | transfer-limit | top }

cluster

バージョン 1.2 の時点で、Riak は Cluster を管理するために複数の段階を踏むアプローチを提供します。Cluster の変更を commit する前に、変更内容を確認することを可能にしました。

このアプローチによって Cluster の管理は、すぐに複数のノードを加えるか、あるいは他のノードを削除する間にいくつかのノードを加えるのような、複数の変更をまとめて行なうことを可能にしました。

Details about how a set of staged changes will impact the cluster, listing the future ring ownership as well as the number of transfers necessary to implement the planned changes are provided by the new interface. (なんとなく意味は分かるけど、訳しにくいので省略..)

次のコマンドは、Cluster のメンバーシップを変更するために使われます。これらのコマンドはすぐに反映されません。変更のセットを作成した後で、commit を行なうことで反映されます。

cluster join

で指定したノードを含んでいる Cluster に加えます。

riak-admin cluster join <node>

cluster leave

このノードの担当データを他ノードに再分散し、Cluster から切り離します。

riak-admin cluster leave

で指定したノードの担当データを他ノードに再分散し、Cluster から切り離します。

riak-admin cluster leave <node>

cluster force-remove

で指定したノードの担当データを再分散せずに、Cluster から削除します。このコマンドは、クラッシュして復旧できないノードのために設計されているため、注意して使用されるべきです。

riak-admin cluster force-remove <node>

cluster replace

に指定したノードの全てのデータを で指定したノードに転送し、 に指定したノードを Cluster から取り除きます。

riak-admin cluster replace <node1> <node2>

cluster plan

Cluster の変更ステージを表示します。

riak-admin cluster plan

cluster clear

Cluster の変更ステージを初期化します

riak-admin cluster clear

cluster commit

Cluster の変更ステージをコミットします。コミットを行なう前に、前述した riak-admin cluster plan を使用して Cluster の変更ステージを確認しなければいけません。

riak-admin cluster commit

backup

全クラスタあるいは指定ノードからデータをファイルにバックアップします。 はバックアップを行なうノードを指定します。 はノードに接続するために使われる秘密の Erlang cookie/shared secret を指定します。初期状態では riak が設定されています。 は、バックアップが格納されるファイルへのフルパスを指定します。[[node]] は、バックアップ対象のノードを指定します。クラスタ全体を対象とする場合は all を指定します。

riak-admin backup <node> <cookie> <filename> [[node]]

restore

バックアップから、ノードあるいは Cluster にデータをリストアします。 はリストアを行なうノードを指定します。 はノードに接続するために使われる秘密の Erlang cookie/shared secret を指定します。初期状態では riak が設定されています。 は、バックアップが格納されているファイルへのフルパスを指定します。

riak-admin restore <node> <cookie> <filename>

test

稼働しているノードに、少数の標準的なオペレーションを試します。

riak-admin test

js-reload

内部の Javascript VM を強制的に再起動します。新しくカスタムした内蔵の MapReduce 機能をデプロイするときに便利です。これには、Cluster の全てのノードが稼働している必要があります。

riak-admin js-reload

services

ノード上の利用可能なサービスリスト (例えば riak_kv) を出力します。

riak-admin services

wait-for-service

Waits on a specific watchable service to be available (typically riak_kv). This is useful when (re-)starting a node while the cluster is under load. 稼働しているノード上でどのサービスが利用可能かを確認するためには、前述した "riak-admin services" を使用してください。

riak-admin wait-for-service <service> <nodename>

ringready

Cluster の全てのノードが ring ステートと一致するかどうかを確認します。もし一致していなければ "FALSE" が出力されます。Cluster のメンバーシップを変更した後に、ring ステートが確立していることを確かめるときに便利です。

riak-admin ringready

transfers

ひとつ以上のパーティションの転送を待っているノードを識別します。これは通常、パーティションの所有者が変化した (ノードを追加あるいは削除) 場合や、ノードをリカバリーした後に生じます。

riak-admin transfers

transfer-limit

データの再配置が同時に実行される上限数を変更します。

riak-admin transfer-limit <node> <limit>

down

Marks a node as down so that ring transitions can be performed before the node is brought back online.

riak-admin down <node>

cluster-info

Riak Cluster からシステム情報を出力します。このコマンドは全ノードあるいは一部のノードから情報を集め、ひとつのテキストファイルに出力します。

riak-admin cluster_info <output file> [<node list>]

以下の情報が集められます。

  • Current time and date
  • VM statistics
  • erlang:memory() summary
  • Top 50 process memory hogs
  • Registered process names
  • Registered process name via regs()
  • Non-zero mailbox sizes
  • Ports
  • Applications
  • Timer status
  • ETS summary
  • Nodes summary
  • net_kernel summary
  • inet_db summary
  • Alarm summary
  • Global summary
  • erlang:system_info() summary
  • Loaded modules
  • Riak Core config files
  • Riak Core vnode modules
  • Riak Core ring
  • Riak Core latest ring file
  • Riak Core active partitions
  • Riak KV status
  • Riak KV ringready
  • Riak KV transfers

次のように実行します。

# Output information from all nodes to /tmp/cluster_info.txt
riak-admin cluster_info /tmp/cluster_info.txt

# Output information from the current node
riak-admin cluster_info /tmp/cluster_info.txt local

# Output information from a subset of nodes
riak-admin cluster_info /tmp/cluster_info.txt riak@192.168.1.10 riak@192.168.1.11

member-status

Cluster メンバーのステータスを出力します。

riak-admin member-status

ring-status

Ring ステータス (claimant, its status, ringready, pending ownership handoffs and a list of unreachable nodes) を出力します。

riak-admin ring-status

vnode-status

ローカルノード上で動作している全ての仮想ノードのステータスを出力します。

riak-admin vnode-status

aae-status

This command provides insight into operation of Riak's Active Anti Entropy (AAE) feature.

riak-admin aae-status

The output contains information on AAE key/value partition exchanges, entropy tree building, and key repairs which were triggered by AAE.

  • Exchanges

  • The Last column lists when the most recent exchange between a partition and one of its sibling replicas was performed.

  • The All column shows how long it has been since a partition exchanged with all of its sibling replicas.

  • Entropy Trees

  • The Built column shows when the hash trees for a given partition were created.

  • Keys Repaired

  • The Last column shows the number of keys repaired during the most recent key exchange.

  • The Mean column shows the mean number of keys repaired during all key exchanges since the last node restart.

  • The Max column shows the maximum number of keys repaired during all key exchanges since the last node restart.

全ての AAE ステータス情報はメモリーに記録されているため、ノードを再起動するとリセットされます。Only tree build times are persistent (since trees themselves are persistent). "aae-status" コマンドの詳細な情報は Riak version 1.3 release notes を参照してください。

diag

の診断を行ないます。

riak-admin diag <node>

status

ノードのステータス情報 (パフォーマンス統計、ヘルス情報、バージョン) を出力します。statistics-aggregator を動かすには、設定ファイルで有効にしなければいけません。出力に関する詳細な情報は Inspecting a Riak Node を参照してください。

riak-admin status

reformat-indexes

このコマンドは、2i の Integer インデックスを Riak 1.3.1 用に再構築します。これによって、インデックスを使用した Range クエリーが正確な結果を返すようになります。

riak-admin reformat-indexes [<concurrency>] [<batch size>] --downgrade

The "concurrency" option defaults to 2 and controls how many partitions are concurrently reformatted.

The "batch size" option controls the number of simultaneous key operations and defaults to 100.

The command can be executed while the node is serving requests, and default values are recommended for most cases. You should only change the default values after testing impact on cluster performance.

Information is written to "console.log" upon completion of the process.

A "--downgrade" switch can be specified when downgrading a node to a version of Riak prior to version 1.3.1.

Additional details are available in the Riak 1.3.1 release notes.

top

Top は、Riak 内部の Erlang プロセスが何を行なっているかに関する情報を提供します。Top reports process reductions (an indicator of CPU utilization), memory used and message queue sizes

riak-admin top

End

内容が多くて途中で気力がつきてしまった… 実際に試さなきゃ理解が苦しいサブコマンドがあるなー。別記事で試してみようと思う。

10
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?