snuffkinの遊び場

IT関係、スポーツ、数学等に関することを、気が向いたときに書いてます。

YARNのコマンドrmadminのhelpについて

ちょっとしたTIPSです。「bin/hadoop」のときと同様に、YARNになってもhelpを表示する機能があります。例えば、

bin/yarn rmadmin

を実行すると、

Usage: java RMAdmin
           [-refreshQueues]
           [-refreshNodes]
           [-refreshUserToGroupsMappings]
           [-refreshSuperUserGroupsConfiguration]
           [-refreshAdminAcls]
           [-refreshServiceAcl]
           [-help [cmd]]

Generic options supported are
-conf <configuration file>     specify an application configuration file
-D <property=value>            use value for given property
-fs <local|namenode:port>      specify a namenode
-jt <local|jobtracker:port>    specify a job tracker
-files <comma separated list of files>    specify comma separated files to be copied to the map reduce cluster
-libjars <comma separated list of jars>    specify comma separated jar files to include in the classpath.
-archives <comma separated list of archives>    specify comma separated archives to be unarchived on the compute machines.

The general command line syntax is
bin/hadoop command [genericOptions] [commandOptions]

と表示されます。こういう、ありがたい機能は好きです。「-help [cmd]」と書いてあるので、先ほどの-refreshQueuesオプションの解説を見てみましょう。

bin/yarn rmadmin -help -refreshQueues

上のコマンドを入力すると、以下の結果が返ってきます。

Usage: java RMAdmin [-refreshQueues]

オイオイ、そりゃないでしょ。これじゃ意味が分からない。。。
困ったと思いきや、ちゃんとhelpを見る方法があります。

bin/yarn rmadmin -help

とすると、以下のような結果が返ってきます。

rmadmin is the command to execute Map-Reduce administrative commands.
The full syntax is:

hadoop rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuperUserGroupsConfiguration] [-refreshUserToGroupsMappings] [-refreshAdminAcls] [-refreshServiceAcl] [-help [cmd]]

-refreshQueues: Reload the queues' acls, states and scheduler specific properties.
                ResourceManager will reload the mapred-queues configuration file.

-refreshNodes: Refresh the hosts information at the ResourceManager.

-refreshUserToGroupsMappings: Refresh user-to-groups mappings

-refreshSuperUserGroupsConfiguration: Refresh superuser proxy groups mappings

-refreshAdminAcls: Refresh acls for administration of ResourceManager

-refreshServiceAcl: Reload the service-level authorization policy file
                ResoureceManager will reload the authorization policy file.

-help [cmd]:    Displays help for the given command or all commands if none
                is specified.


Generic options supported are
-conf <configuration file>     specify an application configuration file
-D <property=value>            use value for given property
-fs <local|namenode:port>      specify a namenode
-jt <local|jobtracker:port>    specify a job tracker
-files <comma separated list of files>    specify comma separated files to be copied to the map reduce cluster
-libjars <comma separated list of jars>    specify comma separated jar files to include in the classpath.
-archives <comma separated list of archives>    specify comma separated archives to be unarchived on the compute machines.

The general command line syntax is
bin/hadoop command [genericOptions] [commandOptions]

この方が良いですね。「[cmd]って使えないじゃん」という気もしますが。。。
以上、ちょっとしたTIPSでした。