レジストリ設定

Hadoop サービスレジストリは、Apache Zookeeper の上に構築されています。Hadoop Configuration クラスを通じて設定されます。サービスの作成に使用されるインスタンスがクライアントの動作を制御します。

このドキュメントでは、レジストリクライアントを制御する設定パラメーターをリストしています。

これらのすべての設定のデフォルト値は、core-default.xml で定義されています。このファイルの値は、このドキュメントにリストされている値と一致しない場合があります。この場合、core-default.xml の値は標準とみなす必要があります。

設定値の変更

設定値の変更は、core-site.xml で行う必要があります。これにより、クライアントおよび非 YARN アプリケーションが値を取得し、レジストリからの読み取りや書き込みが可能になります。

コア設定

Zookeeper クォーラムの設定: hadoop.registry.zk.quorum

これは必須の設定です。Zookeeper ホストと ZK サービスがリスンしているポートのリストを識別します。

  <property>
    <description>
      A comma separated list of hostname:port pairs defining the
      zookeeper quorum binding for the registry
    </description>
    <name>hadoop.registry.zk.quorum</name>
    <value>localhost:2181</value>
  </property>

zk1:2181 ,zk2:2181, zk3:2181 のようなカンマ区切りリストを使用します。

Zookeeper レジストリベースパスの設定: hadoop.registry.zk.root

このパスは、レジストリのベース Zookeeper ノードを設定します。

  <property>
    <description>
      The root zookeeper node for the registry
    </description>
    <name>hadoop.registry.zk.root</name>
    <value>/registry</value>
  </property>

デフォルト値の /registry で通常は十分です。セキュリティ上の理由や、/registry パスが使用中のため、異なる値が必要になる場合があります。

ルート値は、絶対パスを作成するためにすべてのレジストリパスの前に付加されます。例:

  • //registry にマップされます
  • /services/registry/services にマップされます
  • /users/yarn/registry/users/yarn にマップされます

hadoop.registry.zk.root の別の値を使用すると、絶対 Zookeeper パスへのマッピングが異なります。

セキュリティオプション

プロパティ hadoop.registry.securetrue に設定されている場合、レジストリセキュリティが有効になります。設定すると、ノードは権限付きで作成されるため、特定のユーザー *および構成されたクラスターの「スーパーユーザー」アカウント* のみが ${hadoop.registry.zk.root}/users のホームパスに書き込むことができます。スーパーユーザーアカウントのみが、${hadoop.registry.zk.root}/services および ${hadoop.registry.zk.root}/users を含むルートパスを操作できます。

レジストリに対するすべての書き込み操作(エントリとパスの削除を含む)は認証されている必要があります。読み取り操作は、認証されていない呼び出し元でも引き続き許可されます。

セキュアなレジストリサポートのキー設定は次のとおりです。

  • セキュアモードの有効化: hadoop.registry.secure
  • スーパーユーザー Zookeeper ACL のリスト: hadoop.registry.system.acls
  • プリンシパルの Kerberos レルムのリスト: hadoop.registry.kerberos.realm
  • ユーザーを定義する JAAS 構成内の JAAS コンテキストの識別: hadoop.registry.jaas.context

セキュリティの有効化

  <property>
    <description>
      Key to set if the registry is secure. Turning it on
      changes the permissions policy from "open access"
      to restrictions on kerberos with the option of
      a user adding one or more auth key pairs down their
      own tree.
    </description>
    <name>hadoop.registry.secure</name>
    <value>false</value>
  </property>

クライアント JAAS コンテキストの識別

レジストリクライアントは、レジストリに対する認証に使用する JAAS コンテキストを識別する必要があります。

  <property>
    <description>
      Key to define the JAAS context. Used in secure mode
    </description>
    <name>hadoop.registry.jaas.context</name>
    <value>Client</value>
  </property>

Resource Manager はレジストリの単なる別のクライアントであるため、このコンテキストも定義する必要があります。

システムアカウントの識別 hadoop.registry.system.acls

これらは、レジストリのベースへのフルアクセス権が付与されているアカウントです。Resource Manager は、ルートパスを作成するためにこのオプションを必要とします。

レジストリに書き込むクライアントアプリケーションは、作成したノードへのアクセス権を取得します。

  1. プロパティ hadoop.registry.system.acls は、作成されたノードへのフルアクセス権が付与されている Zookeeper ACL のカンマ区切りリストを使用します。権限は READ | WRITE | CREATE | DELETE | ADMIN です。
  2. digest: スキームなど、任意の Zookeeper ACL スキームをこれに追加できます。
  3. SASL スキーム sasl: は、SASL によって識別されたどの呼び出し元にフルアクセス権があるかを識別するために使用されます。これらがスーパーユーザーアカウントです。
  4. これらは、sasl:yarn@REALM.COM などの要素で識別できます。
  5. SASL 設定、特にデフォルト値の移植性を高めるために、レルム値のないすべての sasl: エントリ (つまり、@ 記号で終わるエントリ) には、現在のレルムが付加されます。
  6. このレルムは、現在のユーザーのレルムに設定されます。
  7. プロパティ hadoop.registry.kerberos.realm で上書きできます。
  <property>
    <description>
      A comma separated list of Zookeeper ACL identifiers with
      system access to the registry in a secure cluster.
      These are given full access to all entries.
      If there is an "@" at the end of a SASL entry it
      instructs the registry client to append the default kerberos domain.
    </description>
    <name>hadoop.registry.system.acls</name>
    <value>sasl:yarn@, sasl:mapred@, sasl:mapred@, sasl:hdfs@</value>
  </property>

  <property>
    <description>
      The kerberos realm: used to set the realm of
      system principals which do not declare their realm,
      and any other accounts that need the value.
      If empty, the default realm of the running process
      is used.
      If neither are known and the realm is needed, then the registry
      service/client will fail.
    </description>
    <name>hadoop.registry.kerberos.realm</name>
    <value></value>
  </property>

例: sasl:yarn@, sasl:admin@EXAMPLE.COM, sasl:system@REALM2hadoop.registry.system.acls エントリは、レルム EXAMPLE.COM の YARN クラスターで、次の管理者アカウントをすべてのノードに追加します

  • sasl:yarn@EXAMPLE.COM
  • sasl:admin@EXAMPLE.COM
  • sasl:system@REALM2

レジストリエントリを作成するクライアントアプリケーションの ID は、作成されたすべてのエントリの権限に自動的に含まれます。たとえば、エントリを作成するアカウントが hbase であった場合、別のエントリが作成されます

  • sasl:hbase@EXAMPLE.COM

重要: システム ACL を設定する場合は、YARN Resource Manager の ID を含めることが重要です

RM は、アプリケーションとコンテナーのクリーンアップ中にルートパスとユーザーパスを作成し、サービスレコードを削除できる必要があります。

Zookeeper 接続管理オプション

一部の低レベルオプションは、ZK 接続 (より具体的には、その障害処理) を管理します。

Zookeeper レジストリクライアントは、Zookeeper に接続するために Apache Curator を使用します。これは、タイムアウトを検出し、Zookeeper クォーラムを形成するサーバーの 1 つに再接続しようとするライブラリです。再試行がトリガーされるのは、タイムアウトが検出された後のみです。

  <property>
    <description>
      Zookeeper session timeout in milliseconds
    </description>
    <name>hadoop.registry.zk.session.timeout.ms</name>
    <value>60000</value>
  </property>

  <property>
    <description>
      Zookeeper connection timeout in milliseconds
    </description>
    <name>hadoop.registry.zk.connection.timeout.ms</name>
    <value>15000</value>
  </property>

  <property>
    <description>
      Zookeeper connection retry count before failing
    </description>
    <name>hadoop.registry.zk.retry.times</name>
    <value>5</value>
  </property>

  <property>
    <description>
    </description>
    <name>hadoop.registry.zk.retry.interval.ms</name>
    <value>1000</value>
  </property>

  <property>
    <description>
      Zookeeper retry limit in milliseconds, during
      exponential backoff.
      This places a limit even
      if the retry times and interval limit, combined
      with the backoff policy, result in a long retry
      period
    </description>
    <name>hadoop.registry.zk.retry.ceiling.ms</name>
    <value>60000</value>
  </property>

レジストリクライアントで使用される再試行戦略は、BoundedExponentialBackoffRetry です。これは、クォーラムに到達できず、失敗するという結論に最終的に至る前に、接続障害時に指数関数的にバックオフします。

構成オプションの完全なセット

  <!-- YARN registry -->

  <property>
    <description>
      A comma separated list of hostname:port pairs defining the
      zookeeper quorum binding for the registry
    </description>
    <name>hadoop.registry.zk.quorum</name>
    <value>localhost:2181</value>
  </property>

  <property>
    <description>
      The root zookeeper node for the registry
    </description>
    <name>hadoop.registry.zk.root</name>
    <value>/registry</value>
  </property>

  <property>
    <description>
      Key to set if the registry is secure. Turning it on
      changes the permissions policy from "open access"
      to restrictions on kerberos with the option of
      a user adding one or more auth key pairs down their
      own tree.
    </description>
    <name>hadoop.registry.secure</name>
    <value>false</value>
  </property>

  <property>
    <description>
      A comma separated list of Zookeeper ACL identifiers with
      system access to the registry in a secure cluster.

      These are given full access to all entries.

      If there is an "@" at the end of a SASL entry it
      instructs the registry client to append the default kerberos domain.
    </description>
    <name>hadoop.registry.system.acls</name>
    <value>sasl:yarn@, sasl:mapred@, sasl:mapred@, sasl:hdfs@</value>
  </property>

  <property>
    <description>
      The kerberos realm: used to set the realm of
      system principals which do not declare their realm,
      and any other accounts that need the value.

      If empty, the default realm of the running process
      is used.

      If neither are known and the realm is needed, then the registry
      service/client will fail.
    </description>
    <name>hadoop.registry.kerberos.realm</name>
    <value></value>
  </property>

  <property>
    <description>
      Key to define the JAAS context. Used in secure
      mode
    </description>
    <name>hadoop.registry.jaas.context</name>
    <value>Client</value>
  </property>


  <property>
    <description>
      Zookeeper session timeout in milliseconds
    </description>
    <name>hadoop.registry.zk.session.timeout.ms</name>
    <value>60000</value>
  </property>

  <property>
    <description>
      Zookeeper session timeout in milliseconds
    </description>
    <name>hadoop.registry.zk.connection.timeout.ms</name>
    <value>15000</value>
  </property>

  <property>
    <description>
      Zookeeper connection retry count before failing
    </description>
    <name>hadoop.registry.zk.retry.times</name>
    <value>5</value>
  </property>

  <property>
    <description>
    </description>
    <name>hadoop.registry.zk.retry.interval.ms</name>
    <value>1000</value>
  </property>

  <property>
    <description>
      Zookeeper retry limit in milliseconds, during
      exponential backoff: {@value}

      This places a limit even
      if the retry times and interval limit, combined
      with the backoff policy, result in a long retry
      period
    </description>
    <name>hadoop.registry.zk.retry.ceiling.ms</name>
    <value>60000</value>
  </property>