isi_for_array

OneFS のコマンドの中で一番クラスタらしくて好きなのが isi_for_array コマンド。

Isilon IQは3台から144台までの「ノード」がみんなで集まって分散ファイルシステムを提供しますが、個々のノードはある意味普通にFreeBSDベースのOSで動いてますので、たまに各ノード上でのコマンドの実行結果を見比べたいときがあります。そんなときに使うのがisi_for_array。

takka171-2# isi_for_array date    
takka171-1: Wed Sep  8 15:04:36 JST 2010
takka171-3: Wed Sep  8 15:04:36 JST 2010
takka171-2: Wed Sep  8 15:04:36 JST 2010

お、ちゃんと時刻が合ってますね。

ちなみに、普通にクラスタとして時刻を見るのであれば、
ちゃんとコマンドはあります。dateを打ったのはあくまで例ですね。

takka171-2# isi config
Welcome to the Isilon IQ configuration console.
<snip>
takka171 >>> date

Current date and time: 2010/09/08 15:06:13 JST

isi_for_arrayは歴史も古く、オプションもいっぱいです。

(OneFS6.0.0時点のヘルプ)

takka171-2# isi_for_array --help

Usage: isi_for_array [OPTION]... [COMMAND]...

Options:
  -a, --array-name ARRAY        Use ARRAY.
  -A, --array-file FILE         Read array information from FILE. The default is
                                to first look for $HOME/.array.xml, and then
                                /etc/ifs/array.xml.
  -d, --directory DIR           Execute commands from DIR on remote machine.
                                Defaults to current working directory. An empty
                                DIR will result in commands being executed in
                                the users home directory on the remote machine.
  -D, --diskless                Run commands from diskless nodes.
  -h, --help                    Print this message and exit.
  -k, --known-hosts-file FILE   Use FILE for ssh known hosts file instead of
                                default /dev/null.
  -l, -u, --user USER           Login as USER instead of default root.
  -n, --nodes NODES             Run commands on the given nodes. Can be
                                specified multiple times. Must be a list of
                                either node names or ranges of node IDs. For
                                example: '1,3-5,neal8,10'. If no nodes are
                                explicitly listed, the whole array is used.
  -p, --pw, --password PASSWORD Use PASSWORD instead of default 'a'.
  -P, --pre-command COMMAND     Execute COMMAND before any other commands. This
                                is useful for setting up the environment. May
                                be specified multiple times. An COMMAND of '-'
                                resets the list of commands.
  -q, --query-password          Prompt the user for a password.
  -Q, --quiet                   Do not print host prefix for each output line
  -s, --serial                  Run commands in serial, not parallel.
  -S, --storage                 Run commands from storage nodes.
  -t, --transport TRANSPORT     Network transport. Default is rpc.
                                Valid transports: rpc, ssh
  -T, --throttle COUNT          Adjust throttling, or 0 to disable throttling.
                                Default is 24.
  -x, --exclude-nodes NODES     Don't run commands on NODES. This argument is
                                specified the same way as the -n option is.
  -X, --exclude-down-nodes      Don't run commands on down nodes. Cluster local
                                use Only.

  Note: -k, -u, -p, and -q flags are only valid for ssh transport
<snip>

昔はsshを使ってノード間でコマンド実行していた名残りで、-qや-pや-tやらありますが、
今はRPC通信をしているのでパスワードは必要ないです。そもそも各ノードのパスワードは同期されてますから、
ノード1に入れる人がノード2のパスワードを知らない、ということはありえないわけで。

よく使うオプションは、-n, -s, -x, -X くらいです。とくに -s は大事です。実行順序が大事な作業はあまりないですが、ログの見栄えを考えると管理作業では必ずつけるっていうくらいつけてますね。

"-x" のよくある使い方。”ノード1のファイルを、他ノードにコピー”

iq71-3# isi_for_array -s ls /etc/hoge
iq71-1: ls: /etc/hoge: No such file or directory
iq71-2: ls: /etc/hoge: No such file or directory
iq71-3: /etc/hoge
iq71-4: ls: /etc/hoge: No such file or directory
iq71-5: ls: /etc/hoge: No such file or directory
iq71-3# cp /etc/hoge /ifs/hoge
iq71-3# isi_for_array -x 3 "cp /ifs/hoge /etc/hoge"
iq71-3# isi_for_array -s ls /etc/hoge
iq71-1: /etc/hoge
iq71-2: /etc/hoge
iq71-3: /etc/hoge
iq71-4: /etc/hoge
iq71-5: /etc/hoge

通常想定される設定ファイルについては、MCPというサービスによって自動的にノード間で同期されていますので、こういった作業は必要ありません。MCP については今後触れたいと思います。