YARNでは、アプリケーションの現在および過去の情報を汎用的な方法で保存および取得するために、タイムラインサーバーが使用されます。タイムラインサーバーには2つの役割があります。
アプリケーションまたはフレームワークに完全に固有の情報の収集と取得。たとえば、Hadoop MapReduceフレームワークには、マップタスク数、リデュースタスク数、カウンターなどの情報を含めることができます。アプリケーション開発者は、アプリケーションマスターまたはアプリケーションのコンテナ内のTimelineClient
を介して、特定の情報をタイムラインサーバーに公開できます。
この情報は、REST APIを介してクエリ可能になり、アプリケーション/フレームワーク固有のUIでレンダリングされます。
以前は、これはアプリケーション履歴サーバーによってMapReduceジョブのみを対象にサポートされていました。タイムラインサーバーの導入により、アプリケーション履歴サーバーはタイムラインサーバーの単なる1つの使用例となります。
一般的な情報には、次のようなアプリケーションレベルのデータが含まれます。
ApplicationSubmissionContext
で設定されたユーザー情報など、一般的なデータは、YARNリソースマネージャーによってタイムラインストアに公開され、完了したアプリケーションに関する情報を表示するためにWeb UIで使用されます。
現状
今後の計画
タイムラインドメインは、タイムラインサーバーのネームスペースを提供し、ユーザーが複数のエンティティをホストし、他のユーザーやアプリケーションからそれらを隔離できるようにします。タイムラインサーバーのセキュリティはこのレベルで定義されます。
「ドメイン」は主に、所有者情報、読み取りおよび書き込みACL情報、作成および変更タイムスタンプ情報を格納します。各ドメインは、YARNクラスター内のすべてのユーザー間で一意である必要のあるIDによって識別されます。
タイムラインエンティティには、概念的なエンティティのメタ情報とそれに関連するイベントが含まれています。
エンティティは、アプリケーション、アプリケーション試行、コンテナ、またはユーザー定義のオブジェクトにすることができます。
これには、タイムラインストア内のエンティティのインデックス作成に使用されるプライマリフィルターが含まれています。したがって、ユーザー/アプリケーションは、プライマリフィルターとして保存する情報を慎重に選択する必要があります。
残りのデータは、インデックスなしの情報として格納できます。各エンティティは、EntityId
とEntityType
によって一意に識別されます。
タイムラインイベントは、アプリケーションの特定のタイムラインエンティティに関連するイベントを表します。
ユーザーは、アプリケーションの起動、コンテナの割り当て、操作の失敗など、ユーザーやクラスターオペレーターにとって関連性があると見なされるその他の情報を自由に定義できます。
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.enabled |
サーバー側では、タイムラインサービスが有効になっているかどうかを示します。クライアント側では、ユーザーはこれを有効にして、クライアントがタイムラインサービスを使用するかどうかを示すことができます。クライアント側でセキュリティとともに有効になっている場合、yarnクライアントはタイムラインサーバーの委任トークンの取得を試みます。デフォルトはfalse です。 |
yarn.resourcemanager.system-metrics-publisher.enabled |
YARNシステムメトリクスがRMによってタイムラインサーバーに公開されるかどうかを制御する設定。デフォルトはfalse です。 |
yarn.timeline-service.generic-application-history.enabled |
タイムライン履歴サービスから一般的なアプリケーションデータをクエリするかどうかをクライアントに示す。有効になっていない場合、アプリケーションデータはリソースマネージャーからのみクエリされます。デフォルトはfalse です。 |
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.store-class |
タイムラインストアのストアクラス名。デフォルトはorg.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore です。 |
yarn.timeline-service.leveldb-timeline-store.path |
leveldbタイムラインストアのストアファイル名。デフォルトは${hadoop.tmp.dir}/yarn/timeline です。 |
yarn.timeline-service.leveldb-timeline-store.ttl-interval-ms |
ミリ秒単位でのleveldbタイムラインストアの削除サイクルの間の待機時間。デフォルトは300000 です。 |
yarn.timeline-service.leveldb-timeline-store.read-cache-size |
バイト単位でのleveldbタイムラインストアの非圧縮ブロックの読み取りキャッシュのサイズ。デフォルトは104857600 です。 |
yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-size |
leveldbタイムラインストアの最近読み取られたエンティティの開始時刻のキャッシュのサイズ(エンティティ数)。デフォルトは10000 です。 |
yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-size |
leveldbタイムラインストアの最近書き込まれたエンティティの開始時刻のキャッシュのサイズ(エンティティ数)。デフォルトは10000 です。 |
yarn.timeline-service.recovery.enabled |
デフォルトはfalse です。 |
yarn.timeline-service.state-store-class |
タイムラインステートストアのストアクラス名。デフォルトはorg.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore です。 |
yarn.timeline-service.leveldb-state-store.path |
leveldbタイムラインステートストアのストアファイル名。 |
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.hostname |
タイムラインサービスWebアプリケーションのホスト名。デフォルトは0.0.0.0 です。 |
yarn.timeline-service.address |
RPCサーバーを起動するタイムラインサーバーのアドレス。デフォルトは${yarn.timeline-service.hostname}:10200 です。 |
yarn.timeline-service.webapp.address |
タイムラインサービスWebアプリケーションのHTTPアドレス。デフォルトは${yarn.timeline-service.hostname}:8188 です。 |
yarn.timeline-service.webapp.https.address |
タイムラインサービスWebアプリケーションのHTTPSアドレス。デフォルトは${yarn.timeline-service.hostname}:8190 です。 |
yarn.timeline-service.bind-host |
サーバーがバインドする実際のアドレス。このオプションのアドレスが設定されている場合、RPCおよびwebappサーバーは、それぞれyarn.timeline-service.address およびyarn.timeline-service.webapp.address で指定されたアドレスとポートにバインドします。これは、0.0.0.0 に設定してサービスをすべてのインターフェースでリッスンさせる場合に最も便利です。 |
yarn.timeline-service.http-cross-origin.enabled |
クロスオリジンWebレスポンスヘッダーが必要なWebサービスに対して、クロスオリジンサポート(CORS)を有効にします。たとえば、タイムラインサーバーにWebサービスリクエストを行うJavaScriptなどです。デフォルトはfalse です。 |
yarn.timeline-service.http-cross-origin.allowed-origins |
許可されるオリジンをカンマ区切りで指定したリスト。regex: で始まる値は正規表現として解釈されます。ワイルドカード(* )を含む値も可能ですが、ここでは正規表現が生成されるため、使用は推奨されず、下位互換性のためのみサポートされています。デフォルトは* です。 |
yarn.timeline-service.http-cross-origin.allowed-methods |
クロスオリジン(CORS)サポートが必要なWebサービスで許可されるメソッドをカンマ区切りで指定したリスト。デフォルトはGET,POST,HEAD です。 |
yarn.timeline-service.http-cross-origin.allowed-headers |
クロスオリジン(CORS)サポートが必要なWebサービスで許可されるヘッダーをカンマ区切りで指定したリスト。デフォルトはX-Requested-With,Content-Type,Accept,Origin です。 |
yarn.timeline-service.http-cross-origin.max-age |
クロスオリジン(CORS)サポートが必要なWebサービスに対して、プリフライトされたリクエストをキャッシュできる秒数。デフォルトは1800 です。 |
HTTPとHTTPSのどちらのバインディングを選択するかは、YARN全体の設定オプションyarn.http.policy
の値に基づいて、TimelineClient
で行われることに注意してください。このポリシーがHTTPS_ONLY
の場合、HTTPSエンドポイントが選択されます。
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.ttl-enable |
タイムラインストア内の古いデータの削除を有効にします。デフォルトはtrue です。 |
yarn.timeline-service.ttl-ms |
タイムラインストアデータの存続時間(ミリ秒単位)。デフォルトは604800000 (7日間)です。 |
yarn.timeline-service.handler-thread-count |
クライアントRPCリクエストを処理するためのハンドラースレッド数。デフォルトは10 です。 |
yarn.timeline-service.client.max-retries |
タイムラインサービスへのデータ発行試行の最大再試行回数。デフォルトは30 です。 |
yarn.timeline-service.client.retry-interval-ms |
タイムラインサービスクライアントの再試行間隔(ミリ秒単位)。デフォルトは1000 です。 |
yarn.timeline-service.generic-application-history.max-applications |
REST APIまたはアプリケーション履歴プロトコルを使用してフェッチし、タイムラインサーバーWeb UIに表示できるアプリケーションの最大数。デフォルトは10000 です。 |
タイムラインサービスでは、有効になっている場合、複数のUIをホストできます。このサービスは、ディレクトリにホストされた静的Webサイトと、バンドルされたwarファイルの両方をサポートできます。Web UIは、設定されたパスの下のタイムラインサービスHTTPポートでホストされます。
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.ui-names |
ホストされるUIをカンマ区切りで指定したリスト。デフォルトはnone です。 |
yarn.timeline-service.ui-on-disk-path.$name |
各ui-namesについて、静的コンテンツをサービスするディレクトリまたはWebアーカイブ(warファイル)の場所へのディスク上のパスを指定する必要があります。 |
yarn.timeline-service.ui-web-path.$name |
各ui-namesについて、タイムラインサーバーのルートからの相対的なWebパスを指定する必要があります。パスはスラッシュで始める必要があります。 |
yarn.timeline-service.http-authentication.type
をkerberos
に設定することで、セキュリティを有効にできます。その後、次の設定オプションを使用できます。
構成プロパティ | 説明 |
---|---|
yarn.timeline-service.http-authentication.type |
タイムラインサーバーHTTPエンドポイントに使用される認証を定義します。サポートされている値は、simple / kerberos / #AUTHENTICATION_HANDLER_CLASSNAME# です。デフォルトはsimple です。 |
yarn.timeline-service.http-authentication.simple.anonymous.allowed |
「simple」認証を使用する場合に、タイムラインサーバーで匿名リクエストを許可するかどうかを示します。デフォルトはtrue です。 |
yarn.timeline-service.principal |
タイムラインサーバーのKerberosプリンシパル。 |
yarn.timeline-service.keytab |
タイムラインサーバーのKerberosキータブ。Unixではデフォルトで/etc/krb5.keytab です。 |
yarn.timeline-service.delegation.key.update-interval |
デフォルトは86400000 (1日)です。 |
yarn.timeline-service.delegation.token.renew-interval |
デフォルトは86400000 (1日)です。 |
yarn.timeline-service.delegation.token.max-lifetime |
デフォルトは604800000 (7日)です。 |
yarn.timeline-service.client.best-effort |
委任トークンを取得できなかった場合に、アプリケーションの失敗と見なすべきか(オプション=false)、またはクライアントがそれなしで情報を発行し続けることを試みるべきか(オプション=true)。デフォルト:false |
以下は、タイムラインサーバーを起動するための基本的な設定です。
<property> <description>Indicate to clients whether Timeline service is enabled or not. If enabled, the TimelineClient library used by end-users will post entities and events to the Timeline server.</description> <name>yarn.timeline-service.enabled</name> <value>true</value> </property> <property> <description>The setting that controls whether yarn system metrics is published on the timeline server or not by RM.</description> <name>yarn.resourcemanager.system-metrics-publisher.enabled</name> <value>true</value> </property> <property> <description>Indicate to clients whether to query generic application data from timeline history-service or not. If not enabled then application data is queried only from Resource Manager.</description> <name>yarn.timeline-service.generic-application-history.enabled</name> <value>true</value> </property>
前述のすべての設定が正しく設定されていると仮定すると、管理者は次のコマンドでタイムラインサーバー/履歴サービスを起動できます。
yarn timelineserver
タイムラインサーバー/履歴サービスをデーモンとして起動するには、次のコマンドを使用します。
$HADOOP_YARN_HOME/sbin/yarn-daemon.sh start timelineserver
ユーザーは、次のコマンドラインを使用して、アプリケーションの汎用履歴データにアクセスできます。
$ yarn application -status <Application ID> $ yarn applicationattempt -list <Application ID> $ yarn applicationattempt -status <Application Attempt ID> $ yarn container -list <Application Attempt ID> $ yarn container -status <Container ID>
実行中のアプリケーションに関する対応する情報を取得するために、同じコマンドを使用できることに注意してください。
開発者は、TimelineEntity
およびTimelineEvent
オブジェクトを作成し、TimelineClient
APIを介してエンティティとイベントをタイムラインサーバーに発行することで、アプリケーションに記録する情報を定義できます。
以下に例を示します。
// Create and start the Timeline client TimelineClient client = TimelineClient.createTimelineClient(); client.init(conf); client.start(); try { TimelineDomain myDomain = new TimelineDomain(); myDomain.setId("MyDomain"); // Compose other Domain info .... client.putDomain(myDomain); TimelineEntity myEntity = new TimelineEntity(); myEntity.setDomainId(myDomain.getId()); myEntity.setEntityType("APPLICATION"); myEntity.setEntityId("MyApp1"); // Compose other entity info TimelinePutResponse response = client.putEntities(entity); TimelineEvent event = new TimelineEvent(); event.setEventType("APP_FINISHED"); event.setTimestamp(System.currentTimeMillis()); event.addEventInfo("Exit Status", "SUCCESS"); // Compose other Event info .... myEntity.addEvent(event); TimelinePutResponse response = timelineClient.putEntities(entity); } catch (IOException e) { // Handle the exception } catch (RuntimeException e) { // In Hadoop 2.6, if attempts submit information to the Timeline Server fail more than the retry limit, // a RuntimeException will be raised. This may change in future releases, being // replaced with a IOException that is (or wraps) that which triggered retry failures. } catch (YarnException e) { // Handle the exception } finally { // Stop the Timeline client client.stop(); }
TimelineClient
実装クラスは、YARN Service
APIのサブクラスです。ライフサイクル管理を容易にするために、CompositeService
の下に配置できます。putEntities()
呼び出しの結果は、TimelinePutResponse
オブジェクトです。これには、タイムラインサーバーによって拒否されたタイムラインエンティティの(できれば空の)リストと、各失敗の原因を示すエラーコードが含まれています。Hadoop 2.6および2.7では、エラーコードは次のとおりです。
エラーコード | 説明 |
---|---|
1 | 開始時間なし |
2 | IOException |
3 | システムフィルターの競合(予約済みフィルターキーを使用) |
4 | アクセス拒否 |
5 | ドメインなし |
6 | 禁止された関係 |
将来、さらにエラーコードが定義される可能性があります。
注:以下は、エンティティを更新するときに注意する必要がある点です。
ユーザーは、Web UIを介してアプリケーションの汎用履歴情報にアクセスできます。
http(s)://<timeline server http(s) address:port>/applicationhistory
タイムラインサーバーへのクエリは現在、REST API呼び出しでのみサポートされています。YARNライブラリには実装されたAPIクライアントはありません。Javaでは、Jerseyクライアントは、セキュアモード(呼び出し元が適切なKerberosトークンまたはキータブを持っている場合)でもサーバーへのクエリに効果的です。
v1 REST APIは、タイムラインサーバーWebサービスのパス/ws/v1/timeline/
の下に実装されています。
以下は、APIの非規範的な説明です。
GET /ws/v1/timeline/
サーバーインスタンスとバージョン情報を記述したJSONオブジェクトを返します。
{ About: "Timeline API", timeline-service-version: "3.0.0-SNAPSHOT", timeline-service-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb", timeline-service-version-built-on: "2015-05-13T19:45Z", hadoop-version: "3.0.0-SNAPSHOT", hadoop-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60", hadoop-version-built-on: "2015-05-13T19:44Z" }
/ws/v1/timeline/domain
/ws/v1/timeline/domain
GET /ws/v1/timeline/domain?owner=$OWNER
JSON形式のTimelineDomains
データ構造で、特定のユーザーに属するドメインのリストを返します。
認証されていないGETでは、owner
を設定する必要があります。
認証されたリクエストでは、owner
はデフォルトで呼び出し元になります。
PUT /ws/v1/timeline/domain
シリアル化されたTimelineDomain
構造体をこのパスにPUTすると、指定/現在のユーザーが所有するドメインのリストにドメインが追加されます。成功した操作はステータスコード200と、エラーのないTimelinePutResponse
を返します。
/ws/v1/timeline/domain/{domainId}
ドメインを記述するJSON形式のTimelineDomain
構造体を返します。
ドメインが見つからない場合は、HTTP 404応答が返されます。
/ws/v1/timeline/domain
新しいタイムラインドメインを作成するか、既存のドメインをオーバーライドします。
新しいドメインを作成しようとするとき、送信のIDは、クラスター内のすべてのドメインで一意である必要があります。
既存のドメインを更新しようとするときは、そのドメインのIDを設定する必要があります。送信者は、ドメインを更新するための適切な権限を持っている必要があります。
送信:TimelineDomain
応答:TimelinePutResponse
/ws/v1/timeline/domain
ユーザーのすべてのドメインのリストを取得します。
所有者が指定されている場合、その所有者名は呼び出し元の名前をオーバーライドします。
クエリパラメーター | 説明 |
---|---|
owner |
リストするドメインの所有者 |
GET https://127.0.0.1:8188/ws/v1/timeline/domain?owner=alice { "domains": [ { "id":"DS_DOMAIN_2", "owner":"alice", "readers":"peter", "writers":"john", "createdtime":1430425000337, "modifiedtime":1430425000337 }, { "id":"DS_DOMAIN_1", "owner":"alice", "readers":"bar", "writers":"foo", "createdtime":1430424955963, "modifiedtime":1430424955963 } , {"id":"DEFAULT", "description":"System Default Domain", "owner":"alice", "readers":"*", "writers":"*", "createdtime":1430424022699, "modifiedtime":1430424022699 } ] }
応答:TimelineDomains
指定された所有者のドメインをリストする権限がユーザーにない場合、ドメインリストのないTimelineDomains
応答が返されます。
/ws/v1/timeline/domain/{domainId}
単一のドメインの詳細を取得します
GET https://127.0.0.1:8188/ws/v1/timeline/domain/DS_DOMAIN_1
応答:TimelineDomain
{ "id":"DS_DOMAIN_1", "owner":"zshen", "readers":"bar", "writers":"foo", "createdtime":1430424955963, "modifiedtime":1430424955963 }
ユーザーがそのドメインの詳細をクエリする権限を持っていない場合、404(見つかりません)例外が返されます。これは、そのIDのエントリがない場合に返されるのと同じ応答です。
Posting Entities API を使用すると、記録したいフレームワークごとの情報を含むエンティティとイベントをタイムラインサーバーに投稿できます。
http(s)://<timeline server http(s) address:port>/ws/v1/timeline
POST
なし
TimelinePutResponse
HTTP リクエスト
POST http://<timeline server http address:port>/ws/v1/timeline
リクエストヘッダー
POST /ws/v1/timeline HTTP/1.1 Accept: application/json Content-Type: application/json Transfer-Encoding: chunked
リクエストボディ
{ "entities" : [ { "entity" : "entity id 0", "entitytype" : "entity type 0", "relatedentities" : { "test ref type 2" : [ "test ref id 2" ], "test ref type 1" : [ "test ref id 1" ] }, "events" : [ { "timestamp" : 1395818851590, "eventtype" : "event type 0", "eventinfo" : { "key2" : "val2", "key1" : "val1" } }, { "timestamp" : 1395818851590, "eventtype" : "event type 1", "eventinfo" : { "key2" : "val2", "key1" : "val1" } } ], "primaryfilters" : { "pkey2" : [ "pval2" ], "pkey1" : [ "pval1" ] }, "otherinfo" : { "okey2" : "oval2", "okey1" : "oval1" }, "starttime" : 1395818851588 }, { "entity" : "entity id 1", "entitytype" : "entity type 0", "relatedentities" : { "test ref type 2" : [ "test ref id 2" ], "test ref type 1" : [ "test ref id 1" ] }, "events" : [ { "timestamp" : 1395818851590, "eventtype" : "event type 0", "eventinfo" : { "key2" : "val2", "key1" : "val1" } }, { "timestamp" : 1395818851590, "eventtype" : "event type 1", "eventinfo" : { "key2" : "val2", "key1" : "val1" } } ], "primaryfilters" : { "pkey2" : [ "pval2" ], "pkey1" : [ "pval1" ] }, "otherinfo" : { "okey2" : "oval2", "okey1" : "oval1" }, "starttime" : 1395818851590 } ] }
必須フィールド
エンティティ: type
および id
。エンティティに1つ以上のイベントが含まれていない限り、starttime
が必須です。 イベント: type
および timestamp
。
タイムラインエンティティリスト API を使用すると、エンティティの開始タイムスタンプで降順にソートされたエンティティオブジェクトのリストを取得できます。エンティティの開始タイムスタンプは、アプリケーションによって指定されたタイムスタンプにすることができます。明示的に指定されていない場合は、ストアによって、エンティティの最初の投稿で受信したイベントの最も早いタイムスタンプに選択されます。
指定された entityType
のすべてのエンティティオブジェクトを取得するには、次の URI を使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/timeline/{entityType}
GET
limit
- 返されるエンティティの数の制限。null の場合、デフォルトは 100 です。windowStart
- 取得する最も早い開始タイムスタンプ(排他的)。null の場合、制限に達するまですべてのエンティティを取得します。windowEnd
- 取得する最新の開始タイムスタンプ(包括的)。null の場合、Long の最大値がデフォルトです。fromId
- fromId
が null でない場合、指定された ID より前および指定された ID を含むエンティティを取得します。指定された ID の開始時刻が見つからない場合は、空のエンティティリストが返されます。このエンティティの開始時刻が windowEnd
より遅い場合は、windowEnd
パラメータが優先されます。fromTs
- fromTs
が null でない場合、指定されたタイムスタンプ以降にストアに挿入されたエンティティを無視します。この比較に使用されるエンティティの挿入タイムスタンプは、エンティティの最初の put が受信されたときのストアのシステム時間です(エンティティの開始時刻ではありません)。primaryFilter
- 指定されたプライマリフィルターを持つエンティティのみを取得します。null の場合、すべてのエンティティを取得します。これはインデックス付き検索であり、フィルターに一致しないエンティティはスキャンされません。secondaryFilters
- プライマリフィルターまたは他の情報で指定されたすべてのフィルターと完全に一致するエンティティのみを取得します。これはインデックス付き検索ではないため、すべてのエンティティがスキャンされますが、フィルターに一致するエンティティのみが返されます。EVENTS
、RELATED_ENTITIES
、PRIMARY_FILTERS
、OTHER_INFO
、LAST_EVENT_ONLY
。フィールドのセットに LAST_EVENT_ONLY
が含まれており、EVENTS
が含まれていない場合、各エンティティの最新のイベントが取得されます。null の場合、すべてのフィールドを取得します。primaryFilter
および secondaryFilters
パラメータのキー/値ペアの値は、異なるデータ型にすることができ、一致はデータ型に依存することに注意してください。ユーザーは値を適切にフォーマットする必要があります。たとえば、123
と "123"
はそれぞれ整数と文字列を意味します。エンティティの primaryFilter
に文字列 "123"
があるが、パラメータが整数 123
に設定されている場合、エンティティは一致しません。同様に、true
はブール値を意味し、"true"
は文字列を意味します。一般に、値は、JSON クリップを解析する jackson
ライブラリと一貫して、特定の Java 型としてキャストされます。
entities
(タイムラインエンティティリスト) オブジェクトの要素タイムラインエンティティのリストをリクエストすると、情報はコンテナオブジェクトのコレクションとして返されます。タイムラインエンティティオブジェクトの構文については、Timeline Entity
も参照してください。
項目 | データ型 | 説明 |
---|---|---|
entities |
タイムラインエンティティオブジェクトの配列 (JSON) | タイムラインエンティティオブジェクトのコレクション |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/timeline/DS_APP_ATTEMPT
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "entities":[ { "entitytype":"DS_APP_ATTEMPT", "entity":"appattempt_1430424020775_0004_000001", "events":[ { "timestamp":1430425008796, "eventtype":"DS_APP_ATTEMPT_END", "eventinfo": { } } { "timestamp":1430425004161, "eventtype":"DS_APP_ATTEMPT_START", "eventinfo": { } } ] "starttime":1430425004161, "domain":"DS_DOMAIN_2", "relatedentities": { }, "primaryfilters": { "user":["zshen"] }, "otherinfo": { } } { "entitytype":"DS_APP_ATTEMPT", "entity":"appattempt_1430424020775_0003_000001", "starttime":1430424959169, "domain":"DS_DOMAIN_1", "events":[ { "timestamp":1430424963836, "eventinfo": { } } { "timestamp":1430424959169, "eventinfo": { } } ] "relatedentities": { }, "primaryfilters": { "user":["zshen"] }, "otherinfo": { } } ] }
Timeline Entity API を使用すると、指定されたエンティティ識別子のエンティティ情報を取得できます。
entityType
値と entityId
値で識別されるエンティティオブジェクトを取得するには、次の URI を使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/timeline/{entityType}/{entityId}
GET
EVENTS
、RELATED_ENTITIES
、PRIMARY_FILTERS
、OTHER_INFO
、LAST_EVENT_ONLY
。フィールドのセットに LAST_EVENT_ONLY が含まれており、EVENTS が含まれていない場合、各エンティティの最新のイベントが取得されます。null の場合、すべてのフィールドを取得します。entity
(タイムラインエンティティ) オブジェクトの要素タイムラインイベントオブジェクトの構文については、Timeline Event List
も参照してください。 primaryfilters
および otherinfo
の value
は String ではなく Object であることに注意してください。
項目 | データ型 | 説明 |
---|---|---|
entity |
string | エンティティ ID |
entitytype |
string | エンティティタイプ |
relatedentities |
map | 関連エンティティの識別子。entityType : [entity1, entity2, …] のマップで構成されています |
events |
list | エンティティのイベント |
primaryfilters |
map | エンティティのプライマリフィルター。key : [value1, value2, …] のマップで構成されています |
otherinfo |
map | エンティティのその他の情報。key : value のマップで構成されています |
starttime |
long | エンティティの開始時刻 |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/timeline/DS_APP_ATTEMPT/appattempt_1430424020775_0003_000001
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "events":[ { "timestamp":1430424959169, "eventtype":"DS_APP_ATTEMPT_START", "eventinfo": {}}], "entitytype":"DS_APP_ATTEMPT", "entity":"appattempt_1430424020775_0003_000001", "starttime":1430424959169, "domain":"DS_DOMAIN_1", "relatedentities": {}, "primaryfilters": { "user":["zshen"] }, "otherinfo": {} } ] }
タイムラインイベント API を使用すると、同じエンティティタイプであるエンティティのリストのイベントオブジェクトを取得できます。各エンティティのイベントは、タイムスタンプの降順にソートされます。
指定された entityType
のイベントオブジェクトを取得するには、次の URI を使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/timeline/{entityType}/events
GET
entityId
- イベントを取得するエンティティ ID。null の場合、イベントは返されません。複数の entityId はカンマ区切りの値として指定できます。limit
- エンティティごとに返されるイベントの数の制限。null の場合、デフォルトはエンティティあたり 100 イベントです。windowStart
- null でない場合、指定された時刻より後のイベントのみを取得します(排他的)windowEnd
- null でない場合、指定された時刻より前のイベントのみを取得します(包括的)eventType
- 返されるイベントを指定されたタイプに制限します。null の場合、すべてのタイプのイベントが返されます。複数の eventType は、カンマ区切りの値として指定できます。events
(タイムラインエンティティリスト) オブジェクトの要素タイムラインイベントのリストをリクエストすると、情報はイベントオブジェクトのコレクションとして返されます。
項目 | データ型 | 説明 |
---|---|---|
events |
タイムラインイベントオブジェクトの配列(JSON) | タイムラインイベントオブジェクトのコレクション |
以下は、単一のイベントオブジェクトの要素です。 eventinfo
および otherinfo
の value
は String ではなく Object であることに注意してください。
項目 | データ型 | 説明 |
---|---|---|
eventtype |
string | イベントタイプ |
eventinfo |
map | イベントの情報。key : value のマップで編成されています |
timestamp |
long | イベントのタイムスタンプ |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/timeline/DS_APP_ATTEMPT/events?entityId=appattempt_1430424020775_0003_000001
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "events": [ { "entity":"appattempt_1430424020775_0003_000001", "entitytype":"DS_APP_ATTEMPT"} "events":[ { "timestamp":1430424963836, "eventtype":"DS_APP_ATTEMPT_END", "eventinfo":{}}, { "timestamp":1430424959169, "eventtype":"DS_APP_ATTEMPT_START", "eventinfo":{}} ], } ] }
ユーザーは、REST API を介してアプリケーションの汎用的な履歴情報にアクセスできます。
about API を使用すると、汎用履歴 REST API の説明とバージョン情報を含むタイムラインの概要リソースを取得できます。
基本的には、YARN TimelineAbout
構造の XML/JSON シリアル化形式です。
タイムラインの概要オブジェクトを取得するには、次の URI を使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/about
GET
なし
about
(アプリケーション) オブジェクトの要素項目 | データ型 | 説明 |
---|---|---|
概要 |
string | サービスに関する説明 |
timeline-service-version |
string | タイムラインサービスバージョン |
timeline-service-build-version |
string | タイムラインサービスのビルドバージョン |
timeline-service-version-built-on |
string | タイムラインサービスがビルドされた時刻 |
hadoop-version |
string | Hadoop バージョン |
hadoop-build-version |
string | Hadoop ビルドバージョン |
hadoop-version-built-on |
string | Hadoop がビルドされた時刻 |
HTTP リクエスト
https://127.0.0.1:8188/ws/v1/applicationhistory/about
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ About: "Generic History Service API", timeline-service-version: "3.0.0-SNAPSHOT", timeline-service-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb", timeline-service-version-built-on: "2015-05-13T19:45Z", hadoop-version: "3.0.0-SNAPSHOT", hadoop-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60", hadoop-version-built-on: "2015-05-13T19:44Z" }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/about Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 748
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <about> <About>Generic History Service API</About> <hadoop-build-version>3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60</hadoop-build-version> <hadoop-version>3.0.0-SNAPSHOT</hadoop-version> <hadoop-version-built-on>2015-05-13T19:44Z</hadoop-version-built-on> <timeline-service-build-version>3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb</timeline-service-build-version> <timeline-service-version>3.0.0-SNAPSHOT</timeline-service-version> <timeline-service-version-built-on>2015-05-13T19:45Z</timeline-service-version-built-on> </about>
Application List API を使用すると、それぞれがアプリケーションを表すリソースのコレクションを取得できます。このリソースで GET 操作を実行すると、アプリケーションオブジェクトのコレクションが取得されます。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps
GET
states
- 指定されたアプリケーション状態に一致するアプリケーション(カンマ区切りのリストとして指定)
finalStatus
- アプリケーションの最終ステータス - アプリケーション自体によって報告されます
user
- ユーザー名
queue
- キュー名
limit
- 返されるアプリオブジェクトの合計数
startedTimeBegin
- 開始時刻がこの時刻で始まるアプリケーション(エポックからの ms 単位で指定)
startedTimeEnd
- 開始時刻がこの時刻で終わるアプリケーション(エポックからの ms 単位で指定)
finishedTimeBegin
- 終了時刻がこの時刻で始まるアプリケーション(エポックからの ms 単位で指定)
finishedTimeEnd
- 終了時刻がこの時刻で終わるアプリケーション(エポックからの ms 単位で指定)
applicationTypes
- 指定されたアプリケーションタイプに一致するアプリケーション(カンマ区切りのリストとして指定)
apps
(アプリケーションリスト) オブジェクトの要素アプリケーションのリストをリクエストすると、情報はアプリケーションオブジェクトのコレクションとして返されます。アプリケーションオブジェクトの構文については、Application
も参照してください。
項目 | データ型 | 説明 |
---|---|---|
app |
アプリオブジェクトの配列(JSON)/ゼロ個以上のアプリケーションオブジェクト(XML) | アプリケーションオブジェクトのコレクション |
HTTP リクエスト
GET http://<timeline server http address:port>/ws/v1/applicationhistory/apps
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "app": [ { "appId":"application_1430424020775_0004", "currentAppAttemptId":"appattempt_1430424020775_0004_000001", "user":"zshen", "name":"DistributedShell", "queue":"default", "type":"YARN", "host":"d-69-91-129-173.dhcp4.washington.edu/69.91.129.173", "rpcPort":-1, "appState":"FINISHED", "progress":100.0, "diagnosticsInfo":"", "originalTrackingUrl":"N/A", "trackingUrl":"http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0004/", "finalAppStatus":"SUCCEEDED", "submittedTime":1430425001004, "startedTime":1430425001004, "finishedTime":1430425008861, "elapsedTime":7857, "unmanagedApplication":"false", "applicationPriority":0, "appNodeLabelExpression":"", "amNodeLabelExpression":"" }, { "appId":"application_1430424020775_0003", "currentAppAttemptId":"appattempt_1430424020775_0003_000001", "user":"zshen", "name":"DistributedShell", "queue":"default", "type":"YARN", "host":"d-69-91-129-173.dhcp4.washington.edu/69.91.129.173", "rpcPort":-1, "appState":"FINISHED", "progress":100.0, "diagnosticsInfo":"", "originalTrackingUrl":"N/A", "trackingUrl":"http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0003/", "finalAppStatus":"SUCCEEDED", "submittedTime":1430424956650, "startedTime":1430424956650, "finishedTime":1430424963907, "elapsedTime":7257, "unmanagedApplication":"false", "applicationPriority":0, "appNodeLabelExpression":"", "amNodeLabelExpression":"" }, { "appId":"application_1430424020775_0002", "currentAppAttemptId":"appattempt_1430424020775_0002_000001", "user":"zshen", "name":"DistributedShell", "queue":"default", "type":"YARN", "host":"d-69-91-129-173.dhcp4.washington.edu/69.91.129.173", "rpcPort":-1, "appState":"FINISHED", "progress":100.0, "diagnosticsInfo":"", "originalTrackingUrl":"N/A", "trackingUrl":"http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0002/", "finalAppStatus":"SUCCEEDED", "submittedTime":1430424769395, "startedTime":1430424769395, "finishedTime":1430424776594, "elapsedTime":7199, "unmanagedApplication":"false", "applicationPriority":0, "appNodeLabelExpression":"", "amNodeLabelExpression":"" }, { "appId":"application_1430424020775_0001", "currentAppAttemptId":"appattempt_1430424020775_0001_000001", "user":"zshen", "name":"QuasiMonteCarlo", "queue":"default", "type":"MAPREDUCE", "host":"localhost", "rpcPort":56264, "appState":"FINISHED", "progress":100.0, "diagnosticsInfo":"", "originalTrackingUrl":"http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001", "trackingUrl":"http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/", "finalAppStatus":"SUCCEEDED", "submittedTime":1430424053809, "startedTime":1430424072153, "finishedTime":1430424776594, "elapsedTime":18344, "applicationTags":"mrapplication,ta-example", "unmanagedApplication":"false", "applicationPriority":0, "appNodeLabelExpression":"", "amNodeLabelExpression":"" } ] }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 1710
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <apps> <app> <appId>application_1430424020775_0004</appId> <currentAppAttemptId>appattempt_1430424020775_0004_000001</currentAppAttemptId> <user>zshen</user> <name>DistributedShell</name> <queue>default</queue> <type>YARN</type> <host>d-69-91-129-173.dhcp4.washington.edu/69.91.129.173</host> <rpcPort>-1</rpcPort> <appState>FINISHED</appState> <progress>100.0</progress> <diagnosticsInfo></diagnosticsInfo> <originalTrackingUrl>N/A</originalTrackingUrl> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0004/</trackingUrl> <finalAppStatus>SUCCEEDED</finalAppStatus> <submittedTime>1430425001004</submittedTime> <startedTime>1430425001004</startedTime> <finishedTime>1430425008861</finishedTime> <elapsedTime>7857</elapsedTime> <unmanagedApplication>false</unmanagedApplication> <applicationPriority>0</applicationPriority> <appNodeLabelExpression></appNodeLabelExpression> <amNodeLabelExpression></amNodeLabelExpression> </app> <app> <appId>application_1430424020775_0003</appId> <currentAppAttemptId>appattempt_1430424020775_0003_000001</currentAppAttemptId> <user>zshen</user> <name>DistributedShell</name> <queue>default</queue> <type>YARN</type> <host>d-69-91-129-173.dhcp4.washington.edu/69.91.129.173</host> <rpcPort>-1</rpcPort> <appState>FINISHED</appState> <progress>100.0</progress> <diagnosticsInfo></diagnosticsInfo> <originalTrackingUrl>N/A</originalTrackingUrl> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0003/</trackingUrl> <finalAppStatus>SUCCEEDED</finalAppStatus> <submittedTime>1430424956650</submittedTime> <startedTime>1430424956650</startedTime> <finishedTime>1430424963907</finishedTime> <elapsedTime>7257</elapsedTime> <unmanagedApplication>false</unmanagedApplication> <applicationPriority>0</applicationPriority> <appNodeLabelExpression></appNodeLabelExpression> <amNodeLabelExpression></amNodeLabelExpression> </app> <app> <appId>application_1430424020775_0002</appId> <currentAppAttemptId>appattempt_1430424020775_0002_000001</currentAppAttemptId> <user>zshen</user> <name>DistributedShell</name> <queue>default</queue> <type>YARN</type> <host>d-69-91-129-173.dhcp4.washington.edu/69.91.129.173</host> <rpcPort>-1</rpcPort> <appState>FINISHED</appState> <progress>100.0</progress> <diagnosticsInfo></diagnosticsInfo> <originalTrackingUrl>N/A</originalTrackingUrl> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0002/</trackingUrl> <finalAppStatus>SUCCEEDED</finalAppStatus> <submittedTime>1430424769395</submittedTime> <startedTime>1430424769395</startedTime> <finishedTime>1430424776594</finishedTime> <elapsedTime>7199</elapsedTime> <unmanagedApplication>false</unmanagedApplication> <applicationPriority>0</applicationPriority> <appNodeLabelExpression></appNodeLabelExpression> <amNodeLabelExpression></amNodeLabelExpression> </app> <app> <appId>application_1430424020775_0001</appId> <currentAppAttemptId>appattempt_1430424020775_0001_000001</currentAppAttemptId> <user>zshen</user> <name>QuasiMonteCarlo</name> <queue>default</queue> <type>MAPREDUCE</type> <host>localhost</host> <rpcPort>56264</rpcPort> <appState>FINISHED</appState> <progress>100.0</progress> <diagnosticsInfo></diagnosticsInfo> <originalTrackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001</originalTrackingUrl> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/</trackingUrl> <finalAppStatus>SUCCEEDED</finalAppStatus> <submittedTime>1430424053809</submittedTime> <startedTime>1430424053809</startedTime> <finishedTime>1430424072153</finishedTime> <elapsedTime>18344</elapsedTime> <applicationTags>mrapplication,ta-example</applicationTags> <unmanagedApplication>false</unmanagedApplication> <applicationPriority>0</applicationPriority> <appNodeLabelExpression></appNodeLabelExpression> <amNodeLabelExpression></amNodeLabelExpression> </app> </apps>
Application API を使用すると、YARN クラスタで実行されていた特定のアプリケーションに関する情報を含むアプリケーションリソースを取得できます。
基本的には、YARN ApplicationReport
構造の XML/JSON シリアル化形式です。
appid
値で識別されるアプリケーションオブジェクトを取得するには、次の URI を使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}
GET
なし
app
(アプリケーション) オブジェクトの要素項目 | データ型 | 説明 |
---|---|---|
appId |
string | アプリケーション ID |
user |
string | アプリケーションを開始したユーザー |
name |
string | アプリケーション名 |
type |
string | アプリケーションタイプ |
queue |
string | アプリケーションが送信されたキュー |
appState |
string | ResourceManager によるアプリケーションの状態 - 有効な値は YarnApplicationState 列挙型のメンバーです: FINISHED 、FAILED 、KILLED |
finalStatus |
string | アプリケーションが終了した場合の最終ステータス - アプリケーション自体によって報告されます - 有効な値は次のとおりです: UNDEFINED 、SUCCEEDED 、FAILED 、KILLED |
進捗 |
浮動小数点数 | アプリケーションの進捗状況をパーセントで報告します。長時間実行されるYARNサービスでは、意味のある値を提供しない場合や、実際のコンテナ数と目標コンテナ数のメトリックとして使用する場合があります。 |
追跡URL |
string | アプリケーションのWeb URL(RMプロキシ経由) |
元の追跡URL |
string | アプリケーションの実際のWeb URL |
診断情報 |
string | 完了したアプリケーションに関する詳細な診断情報 |
開始時刻 |
long | アプリケーションが開始された時刻(エポックからのミリ秒単位) |
終了時刻 |
long | アプリケーションが終了した時刻(エポックからのミリ秒単位) |
経過時間 |
long | アプリケーションが開始されてからの経過時間(ミリ秒単位) |
割り当てられたMB |
整数 | アプリケーションの実行中のコンテナに割り当てられたメモリの合計(MB単位) |
割り当てられた仮想コア数 |
整数 | アプリケーションの実行中のコンテナに割り当てられた仮想コア数の合計 |
現在のアプリケーション試行ID |
string | 最新のアプリケーション試行ID |
ホスト |
string | ApplicationMasterのホスト |
RPCポート |
整数 | ApplicationMasterのRPCポート。IPCサービスが宣言されていない場合はゼロ |
アプリケーションタグ |
string | アプリケーションのタグ。 |
非管理アプリケーション |
ブール値 | アプリケーションが非管理であるかどうか。 |
アプリケーション優先度 |
整数 | 送信されたアプリケーションの優先度。 |
アプリノードラベル式 |
string | アプリケーションのコンテナがデフォルトで実行されるノードを識別するために使用されるノードラベル式。 |
AMノードラベル式 |
string | アプリケーションのAMコンテナが実行されるノードを識別するために使用されるノードラベル式。 |
HTTP リクエスト
https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "appId": "application_1430424020775_0001", "currentAppAttemptId": "appattempt_1430424020775_0001_000001", "user": "zshen", "name": "QuasiMonteCarlo", "queue": "default", "type": "MAPREDUCE", "host": "localhost", "rpcPort": 56264, "appState": "FINISHED", "progress": 100.0, "diagnosticsInfo": "", "originalTrackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001", "trackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/", "finalAppStatus": "SUCCEEDED", "submittedTime": 1430424053809, "startedTime": 1430424053809, "finishedTime": 1430424072153, "elapsedTime": 18344, "applicationTags": mrapplication,tag-example, "unmanagedApplication": "false", "applicationPriority": 0, "appNodeLabelExpression": "", "amNodeLabelExpression": "" }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001 Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 873
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <app> <appId>application_1430424020775_0001</appId> <currentAppAttemptId>appattempt_1430424020775_0001_000001</currentAppAttemptId> <user>zshen</user> <name>QuasiMonteCarlo</name> <queue>default</queue> <type>MAPREDUCE</type> <host>localhost</host> <rpcPort>56264</rpcPort> <appState>FINISHED</appState> <progress>100.0</progress> <diagnosticsInfo></diagnosticsInfo> <originalTrackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001</originalTrackingUrl> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/</trackingUrl> <finalAppStatus>SUCCEEDED</finalAppStatus> <submittedTime>1430424053809</submittedTime> <startedTime>1430424053809</startedTime> <finishedTime>1430424072153</finishedTime> <elapsedTime>18344</elapsedTime> <applicationTags>mrapplication,ta-example</applicationTags> <unmanagedApplication>false</unmanagedApplication> <applicationPriority>0</applicationPriority> <appNodeLabelExpression><appNodeLabelExpression> <amNodeLabelExpression><amNodeLabelExpression> </app>
アプリケーション試行リストAPIを使用すると、それぞれがアプリケーション試行を表すリソースのコレクションを取得できます。このリソースでGET操作を実行すると、アプリケーション試行オブジェクトのコレクションが取得されます。
appid
値で識別されるアプリケーションのすべての試行オブジェクトを取得するには、次のURIを使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts
GET
なし
appattempts
(アプリケーション試行リスト)オブジェクトの要素アプリケーション試行リストのリクエストを行うと、情報はアプリケーション試行オブジェクトのコレクションとして返されます。アプリケーション試行オブジェクトの構文については、アプリケーション試行を参照してください。
項目 | データ型 | 説明 |
---|---|---|
appattempt |
appattemptオブジェクトの配列(JSON)/ゼロ個以上のアプリケーション試行オブジェクト(XML) | アプリケーション試行オブジェクトのコレクション |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "appAttempt": [ { "appAttemptId": "appattempt_1430424020775_0001_000001", "host": "localhost", "rpcPort": 56264, "trackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/", "originalTrackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001", "diagnosticsInfo": "", "appAttemptState": "FINISHED", "amContainerId": "container_1430424020775_0001_01_000001" } ] }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appAttempts> <appAttempt> <appAttemptId>appattempt_1430424020775_0001_000001</appAttemptId> <host>localhost</host> <rpcPort>56264</rpcPort> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/</trackingUrl> <originalTrackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001</originalTrackingUrl> <diagnosticsInfo></diagnosticsInfo> <appAttemptState>FINISHED</appAttemptState> <amContainerId>container_1430424020775_0001_01_000001</amContainerId> </appAttempt> </appAttempts>
アプリケーション試行APIを使用すると、YARNクラスターで実行されていたアプリケーションの特定のアプリケーション試行に関する情報を含むアプリケーション試行リソースを取得できます。
appid
値とappattemptid
値で識別されるアプリケーション試行オブジェクトを取得するには、次のURIを使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}
GET
なし
appattempt
(アプリケーション試行)オブジェクトの要素項目 | データ型 | 説明 |
---|---|---|
appAttemptId |
string | アプリケーション試行ID |
amContainerId |
string | ApplicationMasterコンテナID |
appAttemptState |
string | ResourceManagerによるアプリケーション試行状態 - 有効な値はYarnApplicationAttemptState列挙型のメンバーです:FINISHED、FAILED、KILLED |
追跡URL |
string | アプリケーションの追跡に使用できるWeb URL |
元の追跡URL |
string | アプリケーションの実際のWeb URL |
診断情報 |
string | 詳細な診断情報 |
ホスト |
string | ApplicationMasterのホスト |
RPCポート |
整数 | ApplicationMasterのRPCポート |
HTTP リクエスト
https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts/appattempt_1430424020775_0001_000001
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "appAttemptId": "appattempt_1430424020775_0001_000001", "host": "localhost", "rpcPort": 56264, "trackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/", "originalTrackingUrl": "http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001", "diagnosticsInfo": "", "appAttemptState": "FINISHED", "amContainerId": "container_1430424020775_0001_01_000001" }
HTTP リクエスト
GET http://<timeline server http address:port>/ws/v1/applicationhistory/apps/application_1395789200506_0001/appattempts/appattempt_1395789200506_0001_000001 Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 488
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appAttempt> <appAttemptId>appattempt_1430424020775_0001_000001</appAttemptId> <host>localhost</host> <rpcPort>56264</rpcPort> <trackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:8088/proxy/application_1430424020775_0001/</trackingUrl> <originalTrackingUrl>http://d-69-91-129-173.dhcp4.washington.edu:19888/jobhistory/job/job_1430424020775_0001</originalTrackingUrl> <diagnosticsInfo></diagnosticsInfo> <appAttemptState>FINISHED</appAttemptState> <amContainerId>container_1430424020775_0001_01_000001</amContainerId> </appAttempt>
コンテナリストAPIを使用すると、それぞれがコンテナを表すリソースのコレクションを取得できます。このリソースでGET操作を実行すると、コンテナオブジェクトのコレクションが取得されます。
appid
値とappattemptid
値で識別されるアプリケーション試行のすべてのコンテナオブジェクトを取得するには、次のURIを使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}/containers
GET
なし
containers
(コンテナリスト)オブジェクトの要素コンテナリストのリクエストを行うと、情報はコンテナオブジェクトのコレクションとして返されます。コンテナオブジェクトの構文については、Container
も参照してください。
項目 | データ型 | 説明 |
---|---|---|
container |
コンテナオブジェクトの配列(JSON)/ゼロ個以上のコンテナオブジェクト(XML) | コンテナオブジェクトのコレクション |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts/appattempt_1430424020775_0001_000001/containers?
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "container": [ { "containerId": "container_1430424020775_0001_01_000007", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 10, "startedTime": 1430424068296, "finishedTime": 1430424073006, "elapsedTime": 4710, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000007/container_1430424020775_0001_01_000007/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000006", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 20, "startedTime": 1430424060317, "finishedTime": 1430424068293, "elapsedTime": 7976, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000006/container_1430424020775_0001_01_000006/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000005", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 20, "startedTime": 1430424060316, "finishedTime": 1430424068294, "elapsedTime": 7978, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000005/container_1430424020775_0001_01_000005/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000003", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 20, "startedTime": 1430424060315, "finishedTime": 1430424068289, "elapsedTime": 7974, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000003/container_1430424020775_0001_01_000003/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000004", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 20, "startedTime": 1430424060315, "finishedTime": 1430424068291, "elapsedTime": 7976, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000004/container_1430424020775_0001_01_000004/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000002", "allocatedMB": 1024, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 20, "startedTime": 1430424060313, "finishedTime": 1430424067250, "elapsedTime": 6937, "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000002/container_1430424020775_0001_01_000002/zshen", "containerExitStatus": -105, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }, { "containerId": "container_1430424020775_0001_01_000001", "allocatedMB": 2048, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 0, "startedTime": 1430424054314, "finishedTime": 1430424079022, "elapsedTime": 24708, "diagnosticsInfo": "", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000001/container_1430424020775_0001_01_000001/zshen", "containerExitStatus": 0, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" } ] }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts/appattempt_1430424020775_0001_000001/containers Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 1428
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <containers> <container> <containerId>container_1430424020775_0001_01_000007</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>10</priority> <startedTime>1430424068296</startedTime> <finishedTime>1430424073006</finishedTime> <elapsedTime>4710</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000007/container_1430424020775_0001_01_000007/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000006</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>20</priority> <startedTime>1430424060317</startedTime> <finishedTime>1430424068293</finishedTime> <elapsedTime>7976</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000006/container_1430424020775_0001_01_000006/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000005</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>20</priority> <startedTime>1430424060316</startedTime> <finishedTime>1430424068294</finishedTime> <elapsedTime>7978</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000005/container_1430424020775_0001_01_000005/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000003</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>20</priority> <startedTime>1430424060315</startedTime> <finishedTime>1430424068289</finishedTime> <elapsedTime>7974</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000003/container_1430424020775_0001_01_000003/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000004</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>20</priority> <startedTime>1430424060315</startedTime> <finishedTime>1430424068291</finishedTime> <elapsedTime>7976</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000004/container_1430424020775_0001_01_000004/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000002</containerId> <allocatedMB>1024</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>20</priority> <startedTime>1430424060313</startedTime> <finishedTime>1430424067250</finishedTime> <elapsedTime>6937</elapsedTime> <diagnosticsInfo>Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 </diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000002/container_1430424020775_0001_01_000002/zshen</logUrl> <containerExitStatus>-105</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> <container> <containerId>container_1430424020775_0001_01_000001</containerId> <allocatedMB>2048</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>0</priority> <startedTime>1430424054314</startedTime> <finishedTime>1430424079022</finishedTime> <elapsedTime>24708</elapsedTime> <diagnosticsInfo></diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000001/container_1430424020775_0001_01_000001/zshen</logUrl> <containerExitStatus>0</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container> </containers>
コンテナAPIを使用すると、YARNクラスターで実行されていたアプリケーションのアプリケーション試行の特定のコンテナに関する情報を含むコンテナリソースを取得できます。
appid
値、appattemptid
値、およびcontainerid
値で識別されるコンテナオブジェクトを取得するには、次のURIを使用します。
http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}/containers/{containerid}
GET
なし
container
(コンテナ)オブジェクトの要素項目 | データ型 | 説明 |
---|---|---|
containerId |
string | コンテナID |
containerState |
string | ResourceManagerによるコンテナ状態 - 有効な値はContainerState列挙型のメンバーです:COMPLETE |
containerExitStatus |
整数 | コンテナ終了ステータス |
logUrl |
string | コンテナの集約されたログにアクセスするために使用できるログURL |
診断情報 |
string | 詳細な診断情報 |
開始時刻 |
long | コンテナが開始された時刻(エポックからのミリ秒単位) |
終了時刻 |
long | コンテナが終了した時刻(エポックからのミリ秒単位) |
経過時間 |
long | コンテナが開始されてからの経過時間(ミリ秒単位) |
割り当てられたMB |
整数 | コンテナに割り当てられたメモリ(MB単位) |
割り当てられた仮想コア数 |
整数 | コンテナに割り当てられた仮想コア数 |
優先度 |
整数 | コンテナの優先度 |
assignedNodeId |
string | コンテナに割り当てられたノードのホストとポート |
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts/appattempt_1430424020775_0001_000001/containers/container_1430424020775_0001_01_000001
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked
レスポンスボディ
{ "containerId": "container_1430424020775_0001_01_000001", "allocatedMB": 2048, "allocatedVCores": 1, "assignedNodeId": "localhost:9105", "priority": 0, "startedTime": 1430424054314, "finishedTime": 1430424079022, "elapsedTime": 24708, "diagnosticsInfo": "", "logUrl": "http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000001/container_1430424020775_0001_01_000001/zshen", "containerExitStatus": 0, "containerState": "COMPLETE", "nodeHttpAddress": "https://127.0.0.1:8042" }
HTTP リクエスト
GET https://127.0.0.1:8188/ws/v1/applicationhistory/apps/application_1430424020775_0001/appattempts/appattempt_1430424020775_0001_000001/containers/container_1430424020775_0001_01_000001 Accept: application/xml
レスポンスヘッダー
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 669
レスポンスボディ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <container> <containerId>container_1430424020775_0001_01_000001</containerId> <allocatedMB>2048</allocatedMB> <allocatedVCores>1</allocatedVCores> <assignedNodeId>localhost:9105</assignedNodeId> <priority>0</priority> <startedTime>1430424054314</startedTime> <finishedTime>1430424079022</finishedTime> <elapsedTime>24708</elapsedTime> <diagnosticsInfo></diagnosticsInfo> <logUrl>http://0.0.0.0:8188/applicationhistory/logs/localhost:9105/container_1430424020775_0001_01_000001/container_1430424020775_0001_01_000001/zshen</logUrl> <containerExitStatus>0</containerExitStatus> <containerState>COMPLETE</containerState> <nodeHttpAddress>https://127.0.0.1:8042</nodeHttpAddress> </container>
タイムラインサーバーパフォーマンステストツールは、タイムラインサーバーの書き込みパフォーマンスを測定するのに役立ちます。テストでは、SimpleEntityWriterマッパーまたはJobHistoryFileReplayマッパーを起動して、タイムラインエンティティをタイムラインサーバーに書き込みます。最後に、マッパーごとのトランザクションレート(ops / s)と合計トランザクションレートが測定され、出力されます。SimpleEntityWriterマッパーを使用してテストを実行すると、マッパーごとのIOレート(KB / s)と合計IOレートも測定および表示されます。
マッパータイプの説明
オプション
[-m <maps>] number of mappers (default: 1) [-v] timeline service version [-mtype <mapper type in integer>] 1. simple entity write mapper (default) 2. jobhistory files replay mapper [-s <(KBs)test>] number of KB per put (mtype=1, default: 1 KB) [-t] package sending iterations per mapper (mtype=1, default: 100) [-d <path>] root path of job history files (mtype=2) [-r <replay mode>] (mtype=2) 1. write all entities for a job in one put (default) 2. write one entity at a time
SimpleEntityWriterテストの実行
bin/hadoop jar performanceTest.jar timelineperformance -m 4 -mtype 1 -s 3 -t 200
SimpleEntityWriterテストの出力例
TRANSACTION RATE (per mapper): 20000.0 ops/s IO RATE (per mapper): 60000.0 KB/s TRANSACTION RATE (total): 80000.0 ops/s IO RATE (total): 240000.0 KB/s
JobHistoryFileReplayマッパーテストの実行
$ bin/hadoop jar performanceTest.jar timelineperformance -m 2 -mtype 2 -d /testInput -r 2
JobHistoryFileReplayマッパーテストの入力例
$ bin/hadoop fs -ls /testInput /testInput/job_1.jhist /testInput/job_1_conf.xml /testInput/job_2.jhist /testInput/job_2_conf.xml
JobHistoryFileReplayテストの出力例
TRANSACTION RATE (per mapper): 4000.0 ops/s IO RATE (per mapper): 0.0 KB/s TRANSACTION RATE (total): 8000.0 ops/s IO RATE (total): 0.0 KB/s